XOR Function
Returns TRUE when an odd number of arguments are TRUE.
Syntax
Parameters
| Parameter | Description | Required |
|---|---|---|
| logical1 | The first condition or logical value to test. | Required |
| logical2 | Additional conditions or logical values to test (optional). | Optional |
Basic Example
Exactly one true
=XOR(TRUE,FALSE)One of the two arguments is TRUE (an odd count), so XOR returns TRUE.
Advanced Examples
Example 1: Two true is false
Check two conditionsBoth true cancels out
=XOR(TRUE,TRUE)Example 2: Three inputs
Cells A1:A3 are TRUE, FALSE, TRUEOdd count of TRUE wins
=XOR(A1:A3)How XOR Works
XOR evaluates each argument as TRUE or FALSE (non-zero numbers count as TRUE), counts how many are TRUE, and returns TRUE when that count is odd and FALSE when even.
Important Notes & Limitations
Available only in Excel 2013 and later.
With exactly two arguments it behaves as classic XOR; with more it is true for any odd number of TRUEs, not 'exactly one'.
Non-numeric, non-logical text arguments cause #VALUE!.
Common Errors & Fixes
#VALUE! errorAn argument is text that is not a valid logical value.Fix: Pass real conditions or TRUE/FALSE constants.
Download Practice File
XOR
xorPractice XOR with Real Data
Download a sample CSV file with pre-populated data and practice exercises for the XOR function. Works in both Excel and Google Sheets.
File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps