AND function

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

First

Logical or { Logical }

The first parameter.

Other

Logical or { Logical } (accepts many)

Additional parameters.

Returns

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 Field1.ValueField1,Value is 20 and Field2.ValueField2,Value is 40, and 4 otherwise:

IF(AND(Field1 = 20, Field2 = 40), 2, 4)IF(AND(Field1 = 20; Field2 = 40); 2; 4)

The formula can also be written using the Calcapp-specific && operator:

IF((Field1 = 20) && (Field2 = 40), 2, 4)IF((Field1 = 20) && (Field2 = 40); 2; 4)

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

Examples

IF(AND(Field1 = 20, Field2 = 40), 2, 4)IF(AND(Field1 = 20; Field2 = 40); 2; 4)

Returns 2 only if Field1.ValueField1,Value is 20 and Field2.ValueField2,Value is 40. Otherwise, 4 is returned.

IF((Field1 = 20) && (Field2 = 40), 2, 4)IF((Field1 = 20) && (Field2 = 40); 2; 4)

Returns 2 only if Field1.ValueField1,Value is 20 and Field2.ValueField2,Value is 40. Otherwise, 4 is returned. This example uses the && operator, which is specific to Calcapp, 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.

AND(SwitchField1:SwitchField20)AND(SwitchField1:SwitchField20)

Returns TRUE only if all switch fields covered by the SwitchField1:SwitchField20SwitchField1:SwitchField20 range are toggled to their "on" positions.