XOR Function in Excel
Intermediate
Returns TRUE if an odd number of arguments are TRUE, FALSE if an even number are TRUE.
Syntax
=XOR(logical1, [logical2], ...)Example
Use Case
Validate that exactly one of two payment methods was selected.
Common Errors to Avoid
- Returns TRUE only when odd number of conditions are TRUE
- Different from OR - XOR(TRUE,TRUE) returns FALSE
- Not available in older Excel versions (requires Excel 2013+)
Pro Tips
Useful for 'one but not both' logic: =XOR(A1='Yes',B1='Yes') validates mutual exclusivity. For exactly one true out of two, XOR is perfect. For more than two conditions, behavior may be unintuitive.
Need help with this formula?
Our AI Formula Generator can write this for you instantly.
Try AI Formula Generator →