This page isn't translated yet, so its text is in English. Function names and formulas are shown in your Excel language.
Excel function · Logic
XOR
TRUE when an odd number of its tests are TRUE; with two tests, exactly one.
What it does
XOR ("exclusive or") checks its tests and returns TRUE when exactly one of two is TRUE, and FALSE when both or neither are. With more than two tests, it is TRUE when an odd number of them are TRUE.
Syntax
=XOR(logical1, [logical2], …)Arguments in square brackets are optional, and … means you can add more of the same. In this Excel language, arguments are separated by ,
Arguments
- logical
- The first test, such as
B2>=50. Add more tests as further arguments.
Example
Ana took two tests. Did she pass exactly one of them?
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Student | Test 1 | Test 2 | Passed exactly one? |
| 2 | Ana | 78 | 49 | TRUE |
The formula in D2:
=XOR(B2>=50,C2>=50)Result: TRUE
78 is at least 50, so the first test is TRUE; 49 isn't, so the second is FALSE. Exactly one is TRUE, so the result is TRUE. If she had passed both, it would be FALSE.
Common mistakes
- Using it as "at least one". That is
OR;XORis FALSE when both are TRUE. - Expecting "exactly one" with three or more tests. Then it is TRUE when an odd number are TRUE, such as all three.
In other Excel languages
Excel translates function names, and in some languages the argument separator too. Type the name your Excel shows.
| Excel language | Function name | Separator |
|---|---|---|
| English | XOR | , |
| Deutsch | XODER | ; |
| Français | OUX | ; |
| Español (España) | XO | ; |
| Español (México) | XO | , |
| 日本語 | XOR | , |
| 한국어 | XOR | , |
| 繁體中文 | XOR | , |
| ไทย | XOR | , |
| ខ្មែរ | XOR | , |
| Tiếng Việt | XOR | ; |