# Excel XOR function #### Description

The Excel XOR function returns a logical “exclusive OR” of all arguments. For two logical arguments, XOR returns TRUE if either one of both arguments is TRUE. In case both are TRUE or both are FALSE, XOR returns FALSE.

#### Syntax

XOR( logical1, [logical2], … )

#### Arguments

logical1 – First condition to evaluate

logical2 – [Optional] Second condition to evaluate

TRUE or FALSE

## How to use the XOR function in Excel

The XOR function performs a logical “exclusive OR” operation. Unlike the normal OR function, which performs an “inclusive OR” operation and returns TRUE if any logical argument is TRUE, the XOR function returns TRUE only in specific cases.

In the simplest case with just two logical arguments, XOR returns TRUE only if exactly one of both arguments is TRUE, but FALSE if both are TRUE or both are FALSE. In the following formula, exactly one of both A1 and B1 has to be greater than 10 to make XOR return TRUE, but if both evaluate TRUE XOR returns FALSE:

= XOR(A1>10, B1>10)

#### For more than 2 logical arguments

For more than 2 logical arguments, XOR returns TRUE if the number of TRUE logicals is odd. For the following formula, the XOR statements only returns TRUE if either 1, 3, or 5 of the logical tests evaluate TRUE:

= XOR(A1>10, B1>10, C1>10, D1>10, E1>10)