XOR function
a logical exclusive OR of all arguments.
Logical · Excel 2013+
Where can you use it?
Teams building reports and business rules. Adapt the example’s decision rule when you need to test a condition or display different results based on it.
Scenario in the workbook
Flag records with exactly one of two flags enabled.
A worked example from the workbook
| Row | A | B |
|---|---|---|
| 6 | First value | Second value |
| 7 | TRUE | TRUE |
| 8 | TRUE | FALSE |
| 9 | FALSE | FALSE |
Record 1
=XOR(A7,B7)Expected resultFALSE
See the inputs and instructions for all 3 examplesSyntax
XOR(logical1, [logical2],…)
Copyable formulas
English Excel · en-US
=XOR(TRUE,FALSE)Turkish Excel · tr-TR
=ÖZELVEYA(DOĞRU;YANLIŞ)Expected result
TRUE
Worked examples
Flag records with exactly one of two flags enabled.
Open the English sheet. Inputs begin at A6. F7:F9 show the live results and G7:G9 show the original results for comparison.
| Row | A | B |
|---|---|---|
| 6 | First value | Second value |
| 7 | TRUE | TRUE |
| 8 | TRUE | FALSE |
| 9 | FALSE | FALSE |
| Case | Formula | Expected result |
|---|---|---|
| Record 1 | =XOR(A7,B7) |
FALSE |
| Record 2 | =XOR(A8,B8) |
TRUE |
| Record 3 | =XOR(A9,B9) |
FALSE |