Page 359 - Excel 2013 All-in-One For Dummies
P. 359

Using Logical Functions
Excel uses the following logical functions, which appear on the Logical com- mand button’s drop-down menu on the Formulas tab of the Ribbon (Alt+ML). All the logical functions return either the logical TRUE or logical FALSE to their cells when their functions are evaluated. Here are the names of the functions along with their argument syntax:
✦ AND(logical1,logical2,...) — tests whether the logical arguments are TRUE or FALSE. If they are all TRUE, the AND function returns TRUE to the cell. If any are FALSE, the AND function returns FALSE.
✦ FALSE() — takes no argument and simply enters logical FALSE in its cell.
✦ IF(logical_test,value_if_true,value_if_false)—testswhetherthelogical_test expression is TRUE or FALSE. If TRUE, the IF function uses the value_if_ true argument and returns it to the cell. If FALSE, the IF function uses the value_if_false argument and returns it to the cell.
✦ IFERROR(value,value_if_error) — returns the value argument when the cell referred to in another logical argument in which the IFERROR function is used doesn’t contain an error value and the value_if_error argument when it does.
✦ IFNA(value,value_if_na) — returns the value argument when the cell referred to in another logical argument in which the IFNA function is used doesn’t contain #NA and the value_if_error argument when it does.
✦ NOT(logical) — tests whether the logical argument is TRUE or FALSE. If TRUE, the NOT function returns FALSE to the cell. IF FALSE, the NOT function returns TRUE to the cell.
✦ OR(logical1,logical2,...)—testswhetherthelogicalargumentsareTRUE or FALSE. If any are TRUE, the OR function returns TRUE. If all are FALSE, the OR function returns FALSE.
✦ TRUE() — takes no argument and simply enters logical TRUE in its cell.
✦ XOR(logical1,logical2,...) — tests whether the logical arguments (usually in an array) are predominantly TRUE or FALSE. When the number of TRUE inputs is odd, the XOR function returns TRUE. When the number of TRUE inputs is even, the XOR function returns FALSE.
The logical_test and logical arguments that you specify for these logical func- tions usually employ the comparison operators (=, <, >, <=, >=, or <>), which themselves return logical TRUE or logical FALSE values. For example, suppose that you enter the following formula in your worksheet:
=AND(B5=D10,C15>=500)
Using Logical Functions 341
  Book III Chapter 2
 Logical Functions and Error Trapping



















































































   357   358   359   360   361