AND (First, Other...) AND (First; Other...)

First

The first logical value or array of logical values.

Other

Additional logical values or arrays of logical values.

Returns

Logical Logical

TRUE if, and only if, all parameters are TRUE and FALSE otherwise.

Returns TRUE if all parameters are TRUE and FALSE otherwise. AND (TRUE, TRUE, FALSE) AND (TRUE; TRUE; FALSE) returns FALSE, because not all parameters are TRUE, but AND (TRUE, TRUE, TRUE) AND (TRUE; TRUE; TRUE) returns TRUE.

Use AND, OR, NOT and XOR in conjunction with IF to express logical conditions.

This formula returns 2 only if Value1 is 20 and Value2 is 40, and 4 otherwise:

IF ( AND (Value1 = 20, Value2 = 40), 2, 4)
IF ( AND (Value1 = 20; Value2 = 40); 2; 4)

The formula can also be written using the && operator (which is not commonly supported by spreadsheets):

IF ((Value1 = 20) && (Value2 = 40), 2, 4)
IF ((Value1 = 20) && (Value2 = 40); 2; 4)

&& is written between the values to test, instead of before them, which can make formulas easier to read.

Examples

IF ( AND (Value1 = 20, Value2 = 40), 2, 4)
IF ( AND (Value1 = 20; Value2 = 40); 2; 4)

Returns 2 only if Value1 is 20 and Value2 is 40. Otherwise, 4 is returned.

IF ((Value1 = 20) && (Value2 = 40), 2, 4)
IF ((Value1 = 20) && (Value2 = 40); 2; 4)

Returns 2 only if Value1 is 20 and Value2 is 40. Otherwise, 4 is returned. This example uses the && operator, which is not commonly supported by spreadsheets, instead of the AND function.

AND ({ TRUE, TRUE, TRUE })
AND ({ TRUE; TRUE; TRUE })

Returns TRUE, because all elements of the array are TRUE.

AND ({ TRUE, TRUE, TRUE, FALSE })
AND ({ TRUE; TRUE; TRUE; FALSE })

Returns FALSE, because a single element of the array is FALSE.

AND ({ TRUE, TRUE, TRUE }, FALSE)
AND ({ TRUE; TRUE; TRUE }; FALSE)

Returns FALSE, because the second parameter is FALSE.

fxEngine Shell Want this in your own terminal? A standalone version is coming. Get notified.
Loading fxEngine Shell