Logical functions
Some of these functions evaluate Boolean expressions as true or false conditions. Others evaluate arguments that aren't actual Boolean expressions, such as text or arithmetic operations that do not make a true or false statement. Logical functions take numbers, arithmetic operations, equations, cell references, and field names as arguments. Logical functions generally interpret nonzero whole or real numbers as true and a 0 argument as false, unless the purpose of the function is to invert the condition of the argument (for example, the NOT function). Some of the functions evaluate text arguments as false, while others return an error.
Evaluates the argument or arguments and returns TRUE if all arguments are true. If one argument is false, the AND function returns FALSE. If the argument is a number or arithmetic operation (such as 1+1) rather than an equation (such as 1+1 = 2), then 0 equals FALSE and all other values equal TRUE. Format: =AND(logical1,logical2,...) Argument: Example: =AND(B1) returns TRUE, meaning that cell B1 contains a nonzero number. Evaluates an expression and returns one of two possible results. Format: =IF(logical,true value,false value) Arguments: Example: =IF(D7>=65,"Pass","Fail") returns "Pass" if cell D7 contains 65 or more. If cell D7 contains 64 or less, this formula returns "Fail." =IF(D7>100,ALERT("Limit exceeded!"),D7) displays a message box with the text "Limit exceeded!" if the value in cell D7 is 101 or greater. If the value of cell D7 is 100 or less, this formula returns the value in cell D7. Determines whether an expression is blank (TRUE) or contains a number or text (FALSE). Format: =ISBLANK(value) Argument: Example: =ISBLANK("test") returns FALSE. Determines whether an error has occurred in evaluating an expression. Format: =ISERROR(value,error type) Arguments: Example: If cell K7 contains text or a valid number, =ISERROR(K7) returns FALSE, meaning that no error was encountered when evaluating cell K7. Determines whether the argument contains a Boolean expression (whether the value, operation, or equation in the argument can be evaluated as either true or false). Returns TRUE (1) if the expression is Boolean and FALSE (0) if it is not. Format: =ISLOGICAL(value) Argument: Example: =ISLOGICAL(1<2) returns TRUE. Tests the contents of a cell for the #N/A! error condition and returns TRUE if it finds it. This function is useful for checking the results of formulas that contain the MATCH, LOOKUP, VLOOKUP, or HLOOKUP functions. Note: The ISNA function is not available in databases. Format: =ISNA(value) Argument: Example: =ISNA(TRUE) returns FALSE because TRUE is a Boolean expression, not an #N/A! error. Determines whether an expression is a number (TRUE) or not (FALSE). Format: =ISNUMBER(value) Argument: Example: =ISNUMBER("a") returns FALSE. Determines whether an expression is text (TRUE) or not (FALSE). Format: =ISTEXT(value) Argument: Example: =ISTEXT("hello") returns TRUE. Gives the opposite result of a logical value or expression. Except for TRUE and FALSE, this function does not interpret text. Format: =NOT(logical) Argument: Example: =NOT(0) returns TRUE because 0 evaluates as FALSE. Evaluates the argument or arguments and returns TRUE if any argument is true and FALSE if all arguments are false. If the argument is a number or arithmetic operation (such as 1+1) rather than an equation (such as 1+1=2), then 0 equals FALSE and all other values equal TRUE. Format: =OR(logical1,logical2,...) Argument: Example: =OR(A1+A2<100,B1+B2<100) returns FALSE if the sums of the indicated cells are both greater than 100, and TRUE if at least one of the sums is less than 100. =OR(5,0,6) returns TRUE because at least one argument is not zero. Related topic
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Table of contents | Index |