Google Sheets XOR Function: Syntax, Examples & Tips

The XOR function returns TRUE if an odd number of its arguments are TRUE, and FALSE if an even number of arguments are TRUE.
Google Sheets
XOR(logical_expression1, [logical_expression2, ...])

One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.

On this page
  1. Parameters
  2. What is an XOR?
  3. A Practical Example
  4. XOR Formula
  5. Result of the Formula
  6. Why Use XOR?
  7. Key Takeaways:
  8. Example use case

Parameters

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.

What is an XOR?

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.

A Practical Example

Imagine you are managing a project with multiple team members, and you want to determine if only one member has completed a specific task.

Team Members Table:

MemberTask Completed
AliceTRUE
BobFALSE
CharlieTRUE

You want to check if exactly one team member has completed the task.

XOR Formula

To achieve this, you would use the XOR function as follows:

Google Sheets
=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.

Result of the Formula

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.

Why Use XOR?

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.

Key Takeaways:

  • XOR: A logical function that returns TRUE if an odd number of arguments are TRUE.
  • Simplicity: Provides a clear way to evaluate multiple conditions without complex formulas.
  • Common Use Cases: Ideal for scenarios where you need to check if exactly one condition is true, such as task completion, voting systems, or binary decision-making.

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!

Example use case

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.

Need more help with Google Sheets formulas?

Sign up for Better Analyst and get unlimited AI-powered formula generation, explanations, and advanced data analysis.

Explore all Google Sheets formulas

Browse our complete library of Google Sheets formula guides

Compare your options

Decide with evidence, not a sales pitch.

Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.

  1. 01ChatGPTOpen a balanced comparison prompt in ChatGPT.
  2. 02ClaudeOpen the same research prompt in Claude.
  3. 03PerplexityResearch the comparison with linked web sources.

AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.