Skip to content

Lessons in your language are coming soon. Formulas already work in your Excel language.

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?

ABCD
1StudentTest 1Test 2Passed exactly one?
2Ana7849TRUE

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; XOR is 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 languageFunction nameSeparator
EnglishXOR,
DeutschXODER;
FrançaisOUX;
Español (España)XO;
Español (México)XO,
日本語XOR,
한국어XOR,
繁體中文XOR,
ไทยXOR,
ខ្មែរXOR,
Tiếng ViệtXOR;

Practise it

More from this module

All functions