XOR

The XOR function returns a logical 'Exclusive Or' of all the arguments. XOR gives TRUE only when the conditions return different truth values.

ArgumentsResult

1 or more test conditions return different results (TRUE and FALSE)

TRUE

All the conditions are TRUE

FALSE

All the conditions are FALSE

FALSE

Syntax

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

Arguments

logical_test1 – The first condition to be evaluated. This is a required argument.

logical_test2,.. – The additional conditions that are to be evaluated. These are optional arguments.

Return value

Either True or False

Example

if(xor(Region == "West", Category=="Urban"), 25, 30)

Returns 25 for all categories in the West except for category Urban, and for all Urban categories except for region West; for all other items, returns 30.

Excel equivalent

XOR

Last updated