XOR Function

Excel 2013+

Summary

The XOR function performs a logical exclusive OR operation across multiple conditions, returning TRUE only when an odd number of arguments evaluate to TRUE. This makes it perfect for detecting exactly one true condition among several tests.

Syntax

XOR(logical1, [logical2],…)

Parameters

Parameter Type Required Description
logical1 Logical Yes First condition to test - must evaluate to TRUE or FALSE
logical2,… Logical No Additional conditions (optional), up to 253 more arguments

Using the XOR Function

XOR excels at scenarios requiring exactly one condition to be true, such as validating single selections, detecting parity in conditions, or simplifying complex logical checks that traditional AND/OR can't handle efficiently.

Common XOR Examples

Basic Two-Condition XOR

=XOR(3>0,2<9)

Both conditions TRUE (odd count), returns FALSE

Single TRUE Condition

=XOR(A1>100,B1="Yes",C1<0)

Returns TRUE only if exactly one of these conditions is met

Array XOR Check

=XOR((A1:A10>100))

TRUE if odd number of cells in range exceed 100 (array formula)

Data Validation

=XOR(B2="A",B2="B")

Ensures exactly one option selected from dropdown

Frequently Asked Questions

XOR requires an ODD number of TRUE values. Two TRUEs is even, so FALSE.

Yes, XOR processes entire ranges and counts total TRUE values across them.

OR returns TRUE if ANY condition is true. XOR returns TRUE only for ODD number of TRUEs.

Common Errors and Solutions

#VALUE! error

Cause: Range contains no logical values (only text/empty cells)

Solution: Ensure arguments evaluate to TRUE/FALSE or reference logical data

Unexpected FALSE result

Cause: Even number of TRUE conditions

Solution: Verify you want odd-number parity, not just 'any true'

Notes

  • Available Excel 2013 and later versions
  • Array formulas: Use Ctrl+Shift+Enter in older Excel
  • Microsoft 365 supports dynamic arrays automatically
  • Perfect for 'radio button' style validations

Compatibility

Available in: Excel 2013, Excel 2016, Excel 2019, Excel 2021, Microsoft 365

Not available in: Excel 2010, Excel 2007, Excel 2003, Earlier versions

Content last reviewed: December 11, 2025
Update frequency: As needed
Excel versions tested: Excel 2013+