‘IF’ worksheet function is used to check the logical result of a condition and based on that result, directing Excel to be perform an action. Actions include doing some calculation or returning to a value.
The syntax is
Go through some of these examples
Here E6 is the cell, which has some value that may be pure number or result of any formula. If value of E6 is greater than 100 return E6 else return nothing (NULL)
If value of E6 is greater than 100 return E6 else return 0
=IF(E6>100,(E6*5),E6)
If value of E6 is greater than 100 return multiplying E6 with 5, else return 0
=IF(E6>100,(E6*5),(E6*6))
If value of E6 is greater than 100 returns multiplying it with 5, else multiply with 6
If sum of E6 and F6 is greater than 100 return as 1 else 0
Important: Do not leave space within formula. Use commas ( , ) Parentheses correctly.
I hope the above examples helped you to get an idea about 'IF' function. Now, go ahead and try yourself to make some formulas using 'IF'.
Tips: You can even use more than one (up to 8) ‘IF’ function in a single formula.
=IF(E6=1,100,IF(E6=2,200,IF(E6=3,300,IF(E6=4,400,IF(E6=5,500,
IF(E6=6,600,IF(E6=7,700,IF(E6=8,800,0))))))))