# NOT function

NOT(Value) NOT(Value)

## Value

Logical or { Logical }

The value to check.

## Returns

Logical or { Logical }

TRUE if the parameter is FALSE and FALSE otherwise.

Negates the logical parameter and returns it. NOT(TRUE)NOT(TRUE) returns FALSE and NOT(FALSE)NOT(FALSE) returns TRUE.

Use NOT, AND, OR 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 not 40, and 4 otherwise:

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

The formula can also be written using the Calcapp-specific && and ! operators:

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.

To make the formula even easier to read, consider replacing the second = operator with either the <> operator or the != operator (which mean "not equal to"):

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

## Examples

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

Returns 2 only if Field1.ValueField1,Value is 20 and Field2.ValueField2,Value is not 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 not 40. Otherwise, 4 is returned. This example uses the && and ! operators, which are specific to Calcapp, instead of the AND and NOT functions.

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 not 40. Otherwise, 4 is returned. This example uses the != operator (inequality) instead of the = operator (equality), fully replacing the `!` operator and the NOT function. In this context, the `!=` and <> operators are equivalent.

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

Returns { FALSE, TRUE, FALSE, TRUE }{ FALSE; TRUE; FALSE; TRUE }, a negated version of the given array.