Pages

2/21/07

How To Use 'IF' Function In Spread Sheet

‘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 logical result of a condition is either true or false. If the condition is true, the function performs an action. In case if the condition is false, the function performs another action.

The syntax is

=IF(CONDITION, if true what to be executed, if false what to be executed)

Go through some of these examples

=IF(E6>100,E6,””)

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(E6>100,E6,0)

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((E6+F6)>100,1,0)

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))))))))