Quick Answer

XOR Function

Returns TRUE when an odd number of arguments are TRUE.

✓ Excel✓ Google SheetsExcel Excel 2013+

Syntax

XOR
(logical1, [logical2], ...)

Parameters

ParameterDescriptionRequired
logical1The first condition or logical value to test.Required
logical2Additional conditions or logical values to test (optional).Optional

Basic Example

Exactly one true

=XOR(TRUE,FALSE)
ResultTRUE

One of the two arguments is TRUE (an odd count), so XOR returns TRUE.

Advanced Examples

Example 1: Two true is false

Check two conditions

Both true cancels out

=XOR(TRUE,TRUE)
Result: FALSE
Two TRUE values are an even count, so XOR returns FALSE.

Example 2: Three inputs

Cells A1:A3 are TRUE, FALSE, TRUE

Odd count of TRUE wins

=XOR(A1:A3)
Result: FALSE
Two of the three are TRUE (even), so the result is FALSE.

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.

1
List conditions
Provide the logical tests or values.
2
Enter XOR
Type =XOR(...) and press Enter.

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

Practice 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.

Works in Google SheetsCompatible with ExcelIncludes exercises

File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps

Frequently Asked Questions

Does XOR mean 'exactly one'?
Only with two arguments; with more it returns TRUE for any odd number of TRUEs.
Which Excel versions support XOR?
Excel 2013 and later, plus Microsoft 365.
How is XOR different from OR?
OR is TRUE if any argument is true; XOR is TRUE only for an odd number of true arguments.