Logical & Validation
One or the Other, Not Both: Exclusive OR (XOR) & Multi-Option Mutual Exclusion
Validate mutually exclusive promotional discounts or approval paths with two-argument XOR, and avoid the 3-argument odd-parity trap using boolean sum equality.
Enforce mutually exclusive incentives without stacking bugs
Commercial deal desks often allow either a Promo Coupon OR a Partner Rebate on an order — never both stacked together, and if checking incentive eligibility, exactly one of the two. For two boolean conditions, XOR(B2 > 0, C2 > 0) returns TRUE when exactly one incentive is active and FALSE when neither (0, 0) or both (>0, >0) are active.
Critical 3-option warning: with three or more arguments, XOR(a, b, c) tests ODD PARITY — meaning XOR(TRUE, TRUE, TRUE) returns TRUE! Whenever you have 3+ mutually exclusive columns, test (--cond1 + --cond2 + --cond3) = 1 (exactly one) or <= 1 (at most one).
| Order | Promo ($) | Rebate ($) | Loyalty ($) | 2-Way XOR(Promo,Rebate) | Exact-1 of 3 Check |
|---|---|---|---|---|---|
| ORD-01 | 25 | 0 | 0 | TRUE (Valid) | Valid (1 active) |
| ORD-02 | 25 | 40 | 0 | FALSE (Stacked!) | Invalid (2 active) |
| ORD-03 | 0 | 0 | 0 | FALSE (None) | None (0 active) |
| ORD-04 | 25 | 40 | 15 | FALSE | Invalid (3 active — XOR3 would say TRUE!) |
Two-Option Strict Exclusive OR Check (Row 2)
Returns "Valid Single Incentive" when either Promo B2 > 0 or Rebate C2 > 0, but not both and not neither.
=IF(XOR(B2 > 0, C2 > 0), "Valid Single Incentive", IF(AND(B2 > 0, C2 > 0), "Invalid Stacked Discounts", "No Incentive"))Safe 3-Column At-Most-One Policy Validator (Row 5)
Counts active incentives across B5, C5, and D5 so 3-way stacking is caught reliably.
=IF((--(B5 > 0) + --(C5 > 0) + --(D5 > 0)) <= 1, "Policy OK", "Violation: Stacked")Try the example
Use the original values or change them to test your understanding.