ISLOGICAL()

Syntax. ISLOGICAL(value)

Definition. This function returns TRUE if the value argument is evaluated to a logical value. Otherwise, the function returns FALSE.

Arguments

  • value (required). The expression (a number, text, a formula without an equal sign, a logical value, an error value, a reference, or a name) that you want to check

Background. This function is one of the nine IS() functions that return a logical value depending on the argument. The argument of the IS() functions is not converted for evaluation. This means that a string consisting of a number is interpreted as a string (not as a number). IS() functions are often used together with the IF() function to pre-test the result of a calculation. The result returned by an IS() function can be used as the basis for conditional formats and validation rules.

Examples. The following examples show how this function can be used.

Logical Values as Messages. With the IF() function, you can replace a logical value with text:

=IF(ISLOGICAL(H60),IF(H60=TRUE,"correct","not correct"),H60)

You could also hide cell H60. Here the ISLOGICAL() function is used to test whether a message makes sense. The second IF() function checks the logical value and translates it.

Visualizing Logical Values. You can use conditional formats to display cells containing the two logical values differently (for example, green for TRUE and red for FALSE) and to match the font color to the background.

If you don’t know which cells need to be formatted, you can start by selecting one of the possible cells and specifying the conditional format. Use the Format Painter to copy the format into the other cells in the range. Enter the following formulas:

=AND(ISLOGICAL(G63),G63)

for the green cells and

=AND(ISLOGICAL(G63),NOT(G63))

for the red cells (assuming that G63 is the first cell). In the first case, the condition is TRUE if the cell contains the logical value TRUE. The second formula checks whether the logical value FALSE exists. For all other results, no color is applied to the cells.

See Also

ISBLANK(), ISERR(), ISERROR(), ISNA(), ISNONTEXT(), ISNUMBER(), ISREF(), ISTEXT()

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.5.15