Excel XOR Function: Syntax, Examples & Tips

The XOR function evaluates multiple conditions, returning TRUE if an odd number of its arguments are TRUE, otherwise FALSE.
Excel
=XOR(logical1, [logical2], ...)

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

Need more than a single XOR formula? Try our free AI for Excel — it reads your entire spreadsheet, answers questions in plain English, and builds charts and analysis in the same chat.

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

Parameters

logical1:
The first condition or logical value that you want to evaluate. This is a required parameter.

logical2:
Additional conditions or logical values that you want to evaluate. This is an optional parameter and you can include multiple logical values.

What is an XOR Formula in Excel?

The XOR function in Excel is a logical function that stands for "exclusive or." It evaluates a set of logical conditions and returns TRUE if an odd number of the conditions are TRUE, and FALSE if an even number of conditions are TRUE. In simpler terms, the XOR function helps you determine if only one of the specified conditions is met, making it useful for scenarios where you want to ensure exclusivity among conditions.

A Practical Example

Imagine you are managing a project status report, and you have the following data in an Excel spreadsheet:

Project Status Table:

TaskCompletedOn HoldNot Started
Task ATRUEFALSEFALSE
Task BFALSETRUEFALSE
Task CFALSEFALSETRUE
Task DTRUETRUEFALSE
Task EFALSEFALSETRUE

You want to check if exactly one of the statuses for each task is TRUE.

XOR Formula

To evaluate whether exactly one status is TRUE for each task, you would use the XOR formula as follows:

Excel
=XOR(B2, C2, D2)

Breakdown of the Formula:

  • B2, C2, D2: These are the logical conditions being evaluated (Completed, On Hold, Not Started).

Result of the Formula

When you apply the formula to each row, it checks the statuses for each task. The output would be:

TaskXOR Result
Task ATRUE
Task BTRUE
Task CTRUE
Task DFALSE
Task ETRUE

Here, the XOR function returns TRUE for Task A, Task B, Task C, and Task E, indicating that exactly one status is TRUE for those tasks. For Task D, it returns FALSE because two statuses are TRUE.

Why Use XOR?

The XOR function is particularly useful when you need to validate conditions where exclusivity is required. It allows you to quickly determine if only one of the specified conditions is met, which can be crucial in decision-making processes.

Key Takeaways:

  • XOR: Returns TRUE if an odd number of conditions are TRUE; otherwise, it returns FALSE.
  • Logical Evaluation: Helps in scenarios where exclusivity among conditions is necessary.
  • Common Use Cases: Ideal for validation checks, decision-making scenarios, and any situation where you need to ensure that only one condition is satisfied.

Understanding how to use the XOR function can significantly enhance your logical evaluations in Excel, enabling you to make informed decisions based on your data.

Happy calculating!

Example use case

You have a table where Column A contains project names and Column B contains the status of each project (either "On Track" or "At Risk"). You can use the XOR function to determine if exactly one of the projects is "On Track" and the other is "At Risk" at any given time. This helps project managers quickly identify situations where there is a mix of project statuses, allowing for timely interventions and resource allocation without the need for more complex logical operations.

Beyond the XOR function: Better Analyst is a full Excel AI that goes well past individual formulas. Upload any spreadsheet and ask questions in plain English — you'll get formulas, data analysis, and charts back in seconds. It's a free AI Excel assistant that works with any .xlsx, .xls, or .csv file — no plugins, no Microsoft 365 required.

Don't have a spreadsheet yet? Use our free AI spreadsheet generator to turn a text prompt into a downloadable Excel file — a full AI Excel sheet maker that builds headers, columns, and formulas from your description.

Need more help with Excel formulas?

Create a free account for formula help, explanations, and spreadsheet analysis. Usage limits depend on your plan.

Explore all Excel formulas

Browse our complete library of Excel 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.

XOR Function in Excel - Better Analyst