Using the Excel XOR Function


Excel's XOR function returns a "logical exclusive" of the OR function. What this means in plain English is that XOR will receive two logical statements from the user. If either statement evaluates to TRUE, the function returns TRUE. However, if both statements are TRUE or if neither statement is TRUE, the function will return FALSE. The normal OR function returns an "inclusive" OR, meaning that TRUE is returned if any of the conditions evaluate to TRUE.


=XOR (logical1, [logical2], ...)

Syntax Breakdown

The logical1 argument is required and should consist of a condition that you would like to test that can evaluate to either TRUE or FALSE. The condition can be logical values, arrays, or references.

logical2 The logical2 and other logical values are optional. The function can test up to 254 conditions.

Usage Notes

The XOR function performs an "exclusive OR" so that TRUE is only returned in certain cases. With two logical values, XOR returns TRUE only if one condition is TRUE. If both are true, then FALSE is returned. When more than two logical values are supplied to the function, TRUE is returned when the number of conditions evaluating to TRUE is odd.

XOR Multiple Logical Values

XOR Errors
XOR will return the #VALUE! error if no logical values are supplied.

XOR Value Error