Canada Flag

Back

Logic Formulas

You will usually use the logical functions to see whether a condition is true or false. However, you can use them to check for multiple conditions also. The most often used of these functions is the "IF" function.

You can also use these functions together. This allows calculations that depend on various conditions (see example questions).

Example questions:

Q I want to find out if three conditions are true and, if they are, return the value "All Good". If any one of them is not true, I want to return the value "Errors". How do I do this without nesting "if" statements.
A Use the "and" function. If the cell you want to examine is B5 and the conditions you want are: it must be greater than cell B4, it must equal cell A5, and it must be less than cell A4 then the formula is
=if(and(B5>B4,B5=A5,B5

Q Same situation as above except that if any on the conditions are true I want to return the value "Good". If all of them are not true, I want to return the value "Errors".
A Use the "or" function. If the cell you want to examine is B5 and the conditions you want are: it must be greater than cell B4, OR it must equal cell A5, OR it must be less than cell A4 then the formula is
=if(or(B5>B4,B5=A5,B5

Copyright © 2001 by Barrie R. Davidson
Last updated April 12, 2001