The XOR function in Google Sheets is a logical function that allows users to determine whether an odd number of conditions or conditions are true, returning a value based on this evaluation. This function can effectively help in scenarios where a specific decision-making process is guided by differing criteria.
Syntax
XOR(logical1, [logical2, ...])
- logical1: The first condition or logical expression to evaluate.
- logical2: Optional. Additional conditions or logical expressions to evaluate.
Example #1
=XOR(TRUE, FALSE)
This function checks if the conditions differ. Since TRUE and FALSE are different, it returns 1.
Example #2
=XOR(5 > 3, 3 > 5)
Here, we evaluate two conditions: 5 is greater than 3 and 3 is greater than 5. Because one is true and the other is false, the result is 1.
Example #3
=XOR(TRUE, TRUE, FALSE)
This evaluates three logical statements. Since there are an odd number of TRUE values (only one is false), the result is 0.
Error handling
- VALUE!: Indicates that the arguments are of incompatible types, such as non-logical values.
- N/A: This error occurs if a reference argument points to an empty cell or range.