XOR returns TRUE when an odd number of its conditions are true — most simply, when exactly one of two conditions is true, but not both.
XOR ("exclusive or") returns TRUE if an odd number of its arguments are TRUE. With exactly two conditions, this means it returns TRUE when exactly one of them is true — not both, and not neither.
This is genuinely different from OR, which returns TRUE if either or both conditions are true.
=XOR(logical1, [logical2], ...)| Argument | Description |
|---|---|
| logical1 required | The first condition. |
| logical2, ... optional | Additional conditions. |
=XOR(A2>100,B2="VIP")Returns TRUE only if exactly one of the two discount conditions is met — if both are true, XOR returns FALSE, useful when discounts should not stack.
=OR(A2>100,B2="VIP")Returns TRUE if either or both conditions are true — the more commonly needed logic for most real situations.
=XOR(A2<>"",B2<>"")Useful for validating that exactly one of two optional fields was filled in, not both, not neither.
| Condition A | Condition B | OR result | XOR result |
|---|---|---|---|
| TRUE | FALSE | TRUE | TRUE |
| TRUE | TRUE | TRUE | FALSE |
| FALSE | FALSE | FALSE | FALSE |
The only case where OR and XOR disagree is when both conditions are true — OR says TRUE (at least one is true), XOR says FALSE (it requires exactly one, not both).
XOR is a genuinely uncommon need in business spreadsheets — double check you do not just want OR, which is far more frequently the right choice.
ExcelPro has 700+ hands-on Excel exercises across 7 career tracks — free to start, no download needed.
Start practicing free →