XOR(logical_expression1, [logical_expression2, ...])One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.
logical_expression1:
The first logical expression that you want to evaluate. This can be a boolean value, a cell reference, or a formula that returns a boolean value.
logical_expression2:
An optional additional logical expression that you want to evaluate. You can include multiple logical expressions, and each can be a boolean value, a cell reference, or a formula that returns a boolean value.
The XOR (exclusive OR) function in Google Sheets is a logical function that returns TRUE if an odd number of its arguments are TRUE, and FALSE if an even number of its arguments are TRUE. This function is particularly useful in scenarios where you need to evaluate multiple conditions and want to determine if only one of them is true.
In simpler terms, XOR allows you to check multiple conditions and see if exactly one of them is satisfied.
Imagine you are managing a project with multiple team members, and you want to determine if only one member has completed a specific task.
| Member | Task Completed |
|---|---|
| Alice | TRUE |
| Bob | FALSE |
| Charlie | TRUE |
You want to check if exactly one team member has completed the task.
To achieve this, you would use the XOR function as follows:
=XOR(B2, B3, B4)In this formula:
B2, B3, and B4 are the cells containing the TRUE/FALSE values for each team member's task completion status.When you apply the XOR formula, the output would be:
| Result |
|---|
| TRUE |
In this case, the result is TRUE because exactly one member (Alice) has completed the task.
If you were to change the status of Charlie to FALSE, the result would then be:
| Result |
|---|
| FALSE |
Now, the result is FALSE because there are no members who have completed the task.
XOR is beneficial because it simplifies the evaluation of multiple conditions, especially when you want to ensure that only one condition is met. It eliminates the need for complex nested IF statements and provides a straightforward way to assess logical conditions.
XOR is a valuable function for anyone working with logical conditions in Google Sheets, enhancing your ability to analyze and interpret data effectively.
Happy spreadsheeting!
You have a table where Column A lists project statuses (Complete, In Progress, Not Started) and Column B indicates if a team member is assigned. Use the XOR formula to identify if exactly one of the statuses is true for each project, ensuring clear accountability.
Sign up for Better Analyst and get unlimited AI-powered formula generation, explanations, and advanced data analysis.
Browse our complete library of Google Sheets formula guides
Compare your options
Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.
AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.