XOR function

XOR(FirstParameter, OtherParameters...) XOR(FirstParameter; OtherParameters...)

FirstParameter

Logical or { Logical }

The first parameter.

OtherParameters

Logical or { Logical } (accepts many)

Additional parameters.

Returns

Logical

TRUE if, and only if, an odd number of parameters are TRUE and FALSE otherwise.

Returns TRUE if an odd number of parameters are TRUE and FALSE otherwise. XOR(TRUE, FALSE, TRUE)XOR(TRUE; FALSE; TRUE) returns FALSE, because there are two TRUE parameters, an even number.

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

"XOR" stands for "exclusive or." When applied to exactly two parameters, it returns TRUE if the parameters differ and FALSE otherwise. These formulas both return TRUE:

XOR(TRUE, FALSE)XOR(TRUE; FALSE)
XOR(FALSE, TRUE)XOR(FALSE; TRUE)

These formulas return FALSE:

XOR(FALSE, FALSE)XOR(FALSE; FALSE)
XOR(TRUE, TRUE)XOR(TRUE; TRUE)

Examples

XOR(TRUE, FALSE)XOR(TRUE; FALSE)

Returns TRUE, because the parameters differ.

XOR(TRUE, TRUE)XOR(TRUE; TRUE)

Returns FALSE, because the parameters do not differ.

XOR({ TRUE, TRUE })XOR({ TRUE; TRUE })

Returns FALSE, because the array elements do not differ.

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

Returns TRUE, because five array elements and parameters are TRUE, and five is an odd number.