Excel Training: IF Function
The IF function allows you to return one value or another based on a condition.
In this example (lesson-6.xlsx), the IF function will have to test the person's age and display "Yes" or "No" based on this test:
Insert the IF function into cell C2 from the "Formulas" tab:
The function window then opens and indicates what information is needed for this function:
You can notice that this function requires 3 arguments (which are the data to be provided to the function).
When your cursor is in the field of an argument, a description is displayed below to help you better understand what data you should provide.
Now add the logical test by clicking on cell B2 (or entering B2) followed by >=18
to get the logical test B2>=18
(which will check if the value of B2 is greater than or equal to 18):
Then enter "Yes" for the value if TRUE and "No" for the value if FALSE:
""
in formulas as is the case here with "Yes" and "No".Then copy the formula:
To obtain: