Working with Functions
Logical Functions
Logical (AKA boolean) values
2
TRUE and FALSE
• A logical value can be one of only two values
TRUE
or
FALSE
3
TRUE
• The following statements are TRUE:
Fish live in water.
Deer live on land.
• The following statements are also TRUE:
3 is greater than 2
2 is less than 3
2 is less than or equal to 3
2 is less than or equal to 2
3 is greater than or equal to 2
3 is greater than or equal to 3
2 is equal to 2
2 is not equal to 3
4
FALSE
• The following statements are FALSE:
Fish live on land.
Deer live in water.
• The following statements are also FALSE:
2 is greater than 3
3 is less than 2
3 is less than or equal to 2
2 is greater than or equal to 3
2 is equal to 3
2 is not equal to 2
5
Logical operators
• In Excel the following "operators" are used
Operator Meaning
> greater than
< less than
>= greater than or equal to
<= less than or equal to
= equal to
<> not equal to
• Examples
3>2 true
3<2 false
6
If Function
• The IF function checks whether a condition is met, and returns
one value if TRUE and another value if FALSE.
The IF function returns Correct because the value in cell A1 is higher
than 10.
Exercise
Calculation of Result
Result
Calculating Commission
Final Result
AND & OR FUNCTION
Or Function
• The OR function returns TRUE if any of the conditions are
TRUE and returns FALSE if all conditions are false.
The OR function returns TRUE because the value in cell A1 is higher than 10.
As a result the IF function returns Correct.
And Function
• The AND Function returns TRUE if all conditions are true
and returns FALSE if any of the conditions are false.
The AND function returns FALSE because the value in cell B2 is
not higher than 5. As a result the IF function returns Incorrect.