Function Reference: XOR

Syntax
=XOR(logical1,[logical2]...[logical255])
Purpose / Description
Returns TRUE if only one of the values passed to the function are TRUE or non-zero.
Arguments
Name Type Description
logical1 any A constant, constant array, reference or nested expression that returns a value to be checked together with any other arguments.  If a range reference or nested expression is used, it may return more than one value in each argument.  Text strings are ignored.
[logical2]...[logical255] any Optional constants, constant arrays, references or nested expressions returning one more additional values for checking.  If a range reference or nested expression is used, it may return more than one value in each argument.  Text strings are ignored.
Return Values
Type Specific Value Description
logical TRUE If one, and only one of the values passed is TRUE or non-zero
logical FALSE If more than one of the values passed is TRUE or non-zero
Also, if all the values passed are FALSE or zero.
error #VALUE! If all the values passed are text strings.
error   Any errors referenced by arguments are returned due to propagation of error values.
Notes / Comments / Advice / Warnings
Note: This function accepts range references that span worksheets in each of its arguments.
Note: This function cannot be used in an array formula to do row-by-row or column-by-column evaluation.  All referenced values are evaluated in a single step.
Advice: If "exclusive or" logic is required in a dynamic array formula, use the sum of comparison approach whereby each condition or set of conditions is summed with each other, and the condition is met if the sum is exactly 1.  This approach is demonstrated in our courses and online examples.
Examples: Open / download sample workbook: AND, OR, XOR, NOT.xlsx