If Function
If Function
Objectives:
•Using the If function in spreadsheets
•Nesting If functions
Simple condition
mark < 34
mark >=35
grade = “A”
Compound condition using AND, OR
AND(AGE>25, CODE=1)
OR(MARK1<40,MARK2<40)
True
Marks gets B
>=210
False
Marks True
have at
least 180
points?
1st If
False
statemen gets a C
t 2nd If
statemen
t
CS&E 1111 ExIFs
NESTED IF
The second argument and/or third argument of an IF
statement can be another IF statement - up to 64
levels of nesting! Here is an example with 2 levels of
nesting – so three outcomes are possible.
IF(condition1,true_value1,IF(condition2,true_
value2,false_value))