Contact

XOR in Excel: Odd-Parity Logic Versus Exactly-One Tests

Logical Intermediate Microsoft Excel

Use Excel XOR for an odd number of true conditions, build a truth table, and avoid applying two-input exclusive-or intuition to three or more flags.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: XOR returns TRUE when an odd number of its tested logical inputs are TRUE. With two conditions this means exactly one is true. With three or more conditions, it is not an exactly-one test.

Syntax and accepted inputs

=XOR(logical1, [logical2], ...)

The first argument is required. Microsoft permits 1 to 254 logical arguments, including logical values, arrays and references. Text and empty cells inside array or reference arguments are ignored; a referenced range with no logical values has a documented #VALUE! result.

The examples use explicit Boolean values and comparisons, avoiding numeric coercion. Ordinary scalar and cell-reference examples here do not require the array-entry workflows that can apply to more complex expressions in older Excel versions.

Example 1: a two-input truth table

Put these logical pairs in A2:B5: FALSE/FALSE, FALSE/TRUE, TRUE/FALSE and TRUE/TRUE. In C2 enter =XOR(A2,B2) and fill down.

Expected results are FALSE, TRUE, TRUE and FALSE. This describes a rule in which one of two options must be selected, while selecting both or neither is rejected.

The function returns a logical value, not the selected option’s name. Keep a label or identifier separately if the report must explain which option satisfied the rule.

Example 2: three true inputs are an important boundary

=XOR(TRUE(),FALSE(),FALSE())
=XOR(TRUE(),TRUE(),FALSE())
=XOR(TRUE(),TRUE(),TRUE())

Expected results are TRUE, FALSE and TRUE. The last case has three true inputs, an odd count. It demonstrates why a three-option “select exactly one” form cannot safely use XOR alone.

For actual logical flags in A8:C8, a separate exactly-one test is =COUNTIF(A8:C8,TRUE)=1. With all three true, that test is FALSE while XOR is TRUE. The two formulas express different policies.

Advanced application: compare two threshold conditions

For numeric amount A12 and numeric days B12:

=XOR(A12>100,B12>30)

The expected result is TRUE for (150,20) and (90,40), but FALSE for (150,40) and (90,20). Exactly one of the two threshold comparisons must hold.

This example is a chosen review rule, not an inferred business policy. If both conditions should trigger review, OR would express that different requirement.

Advanced application: parity as a consistency check

For actual logical flags TRUE, FALSE, TRUE and FALSE, XOR returns FALSE because two inputs are true. Changing one flag flips parity; changing two flags can preserve it.

Therefore parity can detect some changes but cannot establish that every flag is correct. It is not a complete data-integrity or security mechanism. Use it only when odd/even count is the quantity the task actually needs.

Reference inputs and missing values

Put logical TRUE in F2, ordinary text pending in F3 and leave F4 physically empty. =XOR(F2:F4) has documented-rule expectation TRUE because text and empty cells in a reference are ignored. The same range contains only one contributing logical value.

If a rule requires all three fields to be supplied as Boolean values, ignoring pending and blank entries is undesirable. Validate their types and completeness separately. A TRUE result from XOR does not certify that every input field was filled.

Errors and troubleshooting

A range containing only ordinary text and empty cells has documented #VALUE! behavior. Do not replace that error with FALSE and lose the distinction between “an even number of valid true inputs” and “no logical data.”

Check parity versus exactly-one intent first, then the number of inputs and their types. The guide does not establish direct-text argument coercion, numeric inputs, every dynamic-array shape, or native error propagation. These remain separate from the documented reference-input rules and independent truth-table controls.

Availability and version history

  • Current documentation: the dedicated Microsoft reference lists Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel 2024, Excel 2024 for Mac, Excel 2021, Excel 2021 for Mac, Excel 2019, Excel 2016.
  • Introduced: Microsoft’s alphabetical catalog marks XOR as introduced in Excel 2013. Exact first build and platform-specific introduction dates remain unverified.
  • Last functioning version: unknown; a current help listing is not a last-working-build test.
  • Evidence checked: October 15, 2026. Official documentation was freshly retrieved; examples were independently calculated. No native Excel, Mac or web-client execution was performed.

References and verification

Examples use English function names and comma separators. Expected numbers are rounded independent mathematical calculations; documented error expectations are labeled as such. They are not captured Excel output. All illustrative data and policies are fictional.