Some people shy away from using this versatile function because of its apparent complexity. By doing this, they are missing out on one of the most useful functions available in Excel.
Writing the IF function:
=IF(logical_test, value_if_true, value_if_false)
Like all functions or formulas in Excel, this function begins with the equal sign ( = ), and, like all other functions and formulas, the answer goes in the cell where the equal sign is typed. Notice as well that the different parts of the function inside the round brackets are separated by commas ( , ).
Following the equal sign and the keyword âIFâ is the âlogical testâ, which is a question that can only have true or false as the answer. After the logical test are two values - "value_if_true" and "value_if_false". One of these two values will be dislayed in the cell where the function is written.
Which value gets displayed depends on the logical test. Recall that the logical test can only have a true or false answer. If the answer is true, then the first value is displayed. If the answer is false, then the second value is displayed.
IF Function example
=IF(D1 < 26, 100, 200)
Breaking the example down into its three parts we have:
logical test: D1 < 26, ("<" means less than)
value if true: 100
value if false: 200
The results of this function will be:
- If the value in D1 is less than 26, the value shown will be 100.
- If the value in D1 is NOT less than 26, the value shown will be 200.


