- Advanced Excel Functions Tutorial
- Advanced Excel Functions - Home
- Compatibility Functions
- Advanced Excel Functions - Cube
- Database Functions
- Date & Time Functions
- Engineering Functions
- Financial Functions
- Information Functions
- Advanced Excel Functions - Logical
- Lookup & Reference Functions
- Math & Trignometric Functions
- Statistical Functions
- Useful Resources
- Quick Guide
- Useful Resources
- Discussion
Advanced Excel Logical - XOR Function
Description
The XOR function returns a logical Exclusive OR of all arguments. The XOR Function returns TRUE if an odd number of the supplied conditions evaluate to TRUE, and FALSE otherwise.
Syntax
XOR (logical1, [logical2],…)
Arguments
Argument | Description | Required/ Optional |
---|---|---|
logical1 | logical1 is required and subsequent logical values are optional.1 to 254 conditions you want to test that can be either TRUE or FALSE, and can be logical values, arrays, or references. | Required |
logical2, … | Optional |
Notes
Exclusive OR
The Exclusive OR logical operation returns True if one (and only one) of two supplied conditions evaluate to True. It can be thought of as "either A or B, but not both A and B".
When there is just one condition or when there are more than two conditions, the Exclusive OR operation evaluates to True if an odd number of conditions evaluate to True.
The arguments must evaluate to logical values such as TRUE or FALSE, or in arrays or references that contain logical values.
If an array or reference argument contains text or empty cells, those values are ignored.
If the specified range contains no logical values, XOR returns the #VALUE! error value.
You can use an XOR array formula to see if a value occurs in an array. To enter an array formula, press Ctrl+Shift+Enter.
The result of XOR is TRUE when the number of TRUE inputs is odd and FALSE when the number of TRUE inputs is even.
#NAME? Error occurs if Excel does not recognize the function name. This is probably because you have an earlier version of Excel, which does not support the Xor function.
Applicability
Excel 2013, Excel 2016