XOR
Boolean Operator Functions

Basic Description

The Excel Xor function returns the Exclusive Or logical operation for one or more supplied conditions.

I.e. the Xor function returns TRUE if an odd number of the supplied conditions evaluate to TRUE, and returns FALSE otherwise.

Note: the Xor function was only introduced in Excel 2013 and so is not available in earlier versions of Excel.

The format of the function is :

XOR( logical_test1, [logical_test2], ... )

where the logical_test arguments are between 1 and 254 supplied conditions that evaluate to either TRUE or FALSE.

 

Xor Function Examples

The following spreadsheet shows examples of the Excel Xor function.

 Formulas:
 AB
1 =XOR( 1>0, 2>0 ) (conditions evaluate to TRUE, TRUE)
2 =XOR( 1>0, 0>1 ) (conditions evaluate to TRUE, FALSE)
3 =XOR( 0>1, 2>0 ) (conditions evaluate to FALSE, TRUE)
4 =XOR( 0>1, 0>2 ) (conditions evaluate to FALSE, FALSE)
5 =XOR( 1>0, 2>0, 0>1, 0>2 ) (conditions evaluate to TRUE, TRUE, FALSE, FALSE)
6 =XOR( 1>0, 2>0, 3>0, 0>1 ) (conditions evaluate to TRUE, TRUE, TRUE, FALSE)
 Results:
 A
1 FALSE
2 TRUE
3 TRUE
4 FALSE
5 FALSE
6 TRUE

Xor Function Errors

Error
#NAME? - Occurs if Excel does not recognise the function name. This is probably because you have an earlier version of Excel, which does not support the Xor function.
#VALUE! - Occurs if none of the conditions supplied to the Xor function evaluate to logical values.
Excelq.com doing business as a Service of Venttraffic Media Inc. Excel and other words on this site may be trademarks or registered trademarks of Microsoft Corporation. Microsoft Corporation is not connected in any way with this website, and makes no endorsement of the site or its related contents. All rights reserved. Website powered by Venttraffic Media Inc.