Module 10
3 min
XOR Function
Returns TRUE when conditions are different
XOR Function
XOR = Exclusive OR
Returns TRUE when only one condition is true, not both.
Formula
=XOR(condition1, condition2, ...)
How XOR Works
| Condition 1 | Condition 2 | XOR Result |
|---|---|---|
| TRUE | TRUE | FALSE |
| TRUE | FALSE | TRUE |
| FALSE | TRUE | TRUE |
| FALSE | FALSE | FALSE |
4 rows
Key: TRUE only when conditions are different

XOR vs OR
| A | B | OR Result | XOR Result |
|---|---|---|---|
| TRUE | TRUE | TRUE | FALSE |
| TRUE | FALSE | TRUE | TRUE |
| FALSE | TRUE | TRUE | TRUE |
| FALSE | FALSE | FALSE | FALSE |
4 rows
- OR = Either or both → TRUE
- XOR = Either but NOT both → TRUE
Example: Either/Or Discount
Customer gets discount if they have coupon OR member card — but not both (no double discount!)
=XOR(A1="Yes", B1="Yes")
| Coupon (A1) | Member (B1) | Discount? |
|---|---|---|
| Yes | No | TRUE |
| No | Yes | TRUE |
| Yes | Yes | FALSE |
| No | No | FALSE |
4 rows

With IF
=IF(XOR(A1>50, B1>50), "One Passed", "Both or None")
| A1 | B1 | Result |
|---|---|---|
| 60 | 40 | One Passed |
| 40 | 60 | One Passed |
| 60 | 60 | Both or None |
| 40 | 40 | Both or None |
4 rows
When to Use XOR
- Either/or situations (not both)
- Toggle switches
- Checking odd number of TRUE values
- Validation: one option only
Summary
- XOR = TRUE when conditions are different
- Only ONE can be true, not both
- Use for "either but not both" logic
- Formula:
=XOR(cond1, cond2)