Excel XOR Function

Want to learn more about how to Perform exclusive OR using excel spreadsheet?? This post will give you an overview of how to use formula functions to Perform exclusive OR.

Syntax (Generic Formula)

Generic Formula of XOR function

=XOR(Logical 1, Logical 2,........)

  • Logical 1:- An expression / constant / reference that evaluates to TRUE or FALSE in function.
  • Logical 2:- [optional] An expression / constant / reference that evaluates to TRUE or FALSE in function.

How the XOR function Works

The XOR function will return TRUE if one of both statements is true in this way it will return FALSE if both statements are true statements. If neither of both statements is true, then the result will FALSE. We can use the XOR Function if we want to test if one and only one condition is met.

Figure 1: Example of performing exclusive OR

To performing exclusive OR, you can use the XOR function. In the example selected cell shown, the formula in D5 is:

=XOR(B5:C5)

In XOR function, If the logical test arguments which we put evaluate to numbers, instead of logical values, the value zero is treated as FALSE and any non-zero values are treated as TRUE.  

XOR returns TRUE when the number of TRUE inputs is odd and FALSE when the number of TRUE inputs is even. In the example, we only have to cells B5 and C5 (two logical), but if we would have 4 logical (for example) XOR will return TRUE when we have 1 or 3 TRUE Values.

Take a closer look to F5:

Figure 2: Example 2 with more than 2 logical.

More about the XOR Function:

  • XOR function can be used for the conjunction of logical function.
  • This function allows to test up to 254 different functions in excel.
  • XOR function ignores empty references in the cell.
  • When logical values are not found then the error will show #VALUE!
  • XOR is available from Excel 2013 #NAME will be displayed if you try to use it in an earlier version than 2013.
Our customers love us!
“The expert was absolutely amazing and stuck with me the whole way through. They were polite, patient, seemed to want to genuinely help me and provided a solution that I would never have managed otherwise. I could not be more thankful for their support and solution. Thank you!” - - Chris T, in California

Leave a Comment

avatar