Syntax
| Parameter | Description |
|---|---|
| logical1 | Parameter of the XOR function. |
| [logical2 | (Optional.) Parameter of the XOR function. |
| ...] | Parameter of the XOR function. |
Examples
Either/or check
=XOR(A1>100, B1>100)
Parity validation
=XOR(C1="Yes", D1="Yes", E1="Yes")
Toggle switch logic
=XOR(ISBLANK(A2), ISBLANK(B2))
Common Errors
Occurs when an argument cannot be evaluated as a logical value, such as passing text that isn't TRUE/FALSE.
Can occur if a referenced cell contains a #N/A error and isn't wrapped in an error-handling function.
Tips
OR returns TRUE if any argument is TRUE. XOR returns TRUE only when an odd number are TRUE. For a simple "one but not both" check with two arguments, XOR is what you want.
Use =IF(XOR(A1>0, B1>0), "One positive", "Both or neither") to act on the exclusive-or result.
With 3+ arguments, XOR checks parity (odd count of TRUEs), not "exactly one." For exactly-one logic with many arguments, use =COUNTIF(range, TRUE)=1 instead.
Try XOR in Viztab
Import your data and use XOR with 370+ other formulas. No signup required.
Open Viztab