The concept of exclusive OR is more common in the world of programming. In plain English, you can think of a sentence like this: “I’m either going to visit New York or San Francisco this summer”. Nothing prevents the speaker from visiting both, but the meaning is clearly that they plan to visit only one or the other. If they visit one or the other, the original statement is TRUE. If they visit neither or both, the original statement is FALSE.

Example #1 - two values

In the example shown, the formula in D5, copied down, is: At each row, XOR only returns TRUE when B5 and C5 contain a single TRUE or equivalent value.

Example #2 - more than two values

With more than 2 values, the behavior of XOR is a bit different. With three or more logicals, XOR only returns TRUE when the number of TRUE values is odd, as shown in the following example:

In this example, XOR is given a range with five values in a single argument instead of five separate arguments. The formula in G6 copied down is: The result is TRUE only when the number of TRUE values columns B through F is an odd number.

Notes

Logical arguments must evaluate to TRUE or FALSE, 1 or 0, or be references that contain logical values. XOR returns #VALUE! if no logical values are found. With more than two logicals, XOR returns TRUE when the number of TRUE logicals is odd, and FALSE if not. XOR was introduced in Excel 2013.

Dave Bruns

Hi - I’m Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.

Excel XOR function - 96