The IF Function
The IF function is the key logical function used for decision making. It takes the format:
=IF(condition, true, false)
For example, you could use the following formula:
=IF(B2 > 400, “High”, “Low”) where,
B2 > 400 is the condition being tested
(this could be translated as “Is the value in cell B2 greater than 400?”)
“High” is the text to display if B2 is greater than 400 (the result of the test is yes or TRUE)
“Low” is the text to display if B2 is less than or equal to 400 (the result of the test is no or FALSE)
The AND Function
The AND function is used to compare more than one condition. It returns TRUE only if all of the conditions are
met, and takes the format:
=AND(condition1, condition2,…)
For example, you could use the following formula:
=AND(B2 > 400, C2 < 300) where,
B2 > 400 is the first condition being tested
C2 < 300 is the second condition being tested
This will only return the result TRUE if the value in cell B2 is greater than 400 and the value in cell C2 is less
than 300. In all other situations, the result will be FALSE.
The OR Function
The OR function is also used to compare more than one condition. It returns TRUE if any of the conditions are
met, and takes the format:
=OR(condition1, condition2,…)
For example, you could use the following formula:
=OR(B2 > 400, C2 < 300) where,
B2 > 400 is the first condition being tested
C2 < 300 is the second condition being tested
This will return the result TRUE if either the value in cell B2 is greater than 400 or the value in cell C2 is less
than 300. The result will be FALSE only if neither of the conditions is met.