You are on page 1of 4

Chapter 3: Logical Functions

Objectives:

logical functions

 =IF(condition, value if true, value if false) – a returns one value if the condition is true and
another if the condition is false,
 =AND(condition1, condition2, …) – returns TRUE if all conditions are true and FALSE if not,
 =OR(condition1, condition2, …) – returns TRUE if any condition is true and FALSE if not.

example if function: the sample formula displays “increase in sales” if the value of sales in 2011 is
greater than the value of sales in 2010, otherwise it will display “decrease in sales”
 AND/OR operators are used in comparing two conditions/expression

Condition 1 Condition2 AND OR


T T T T
T F F T
F T F T
F F F F

IF Function

 =IF(condition, value if true, value if false)


 Conditions may include the following:

o = equal

o > greater than

o < less than

o <> not equal to

o >= greater than or equal to

o <= less than or equal to

 You may nest up to 7 IF functions, replacing the value if false with another IF function

 Example: =IF(A8 =2,(IF(B3 =5,”YES”,“ ”)),15)

AND Function

 the excel and function Is a logical function used to require more than one condition at the same
time.
 AND returns either TRUE or FALSE
 the AND function can be used as the logical logical test inside the IF function to avoid extra
nested Ifs and can be combined with OR


 in the example 1, the value of A3 is 3. 3 is compared to 0 and 5. since 3 >0 is true and 3<5 is true,
combining the results it will give us TRUE value.
 in example 2, the value of A3 is 10. if we’re going to evaluate it, 10 >0 is true and 10< 5 is false.
applying the rule of AND function/operator, it will give us FALSE value, coz it will only return true
if and only if the results of the conditions are TRUE.
 use it with IF function

o it will perform the true value in the IF function (number is between 0 and 5) because the
conditions were met.

o it will perform the false value of the IF function since the conditions were not met.

OR Function


o since both conditions are true, it will give us a TRUE value because you will only have
false result if all conditions were evaluated to false.

o 10>0 is true, 10< 5 is false, since the Operator/function used is OR, it will still give us
TRUE result. again, when using OR it will only give us false result, if and only if all
conditions evaluated are FALSE.

You might also like