Logical · odd number of TRUE inputs · Nov 2026

The XOR function,
measured & explained.

Syntax, a live playground, a measured truth table and coercion gallery, the eager-evaluation trap, and a sourced error library: odd number of TRUE inputs.

D1
fx
=XOR(A2>=90, B2>=90)
0
truth-table rows measured
0
sourced errors fixed
0
platforms checked
// 01 — Anatomy

How XOR works

Returns TRUE when an odd number of arguments are TRUE — parity, not "exactly one". It returns a single logical value, so it is usually combined with IF to branch to a result.

=XOR(A2>=90, B2>=90)
logical1Required. The first condition to test.
logical2Optional. Additional conditions; parity is over all of them.
parityOdd count of TRUE → TRUE; even → FALSE.
// 02 — Parity

What XOR actually returns

XOR is odd-parity: TRUE when an odd number of arguments are TRUE — not "exactly one". The tables below were measured live in the HyperFormula engine. Click any truth-table row to load it into the live playground.

Truth table

ABXOR(A,B)
TRUETRUEFALSE
TRUEFALSETRUE
FALSETRUETRUE
FALSEFALSEFALSE

What counts as TRUE? (measured coercion)

Numbers, text and blanks do not all behave the same. Every value below was measured in the engine.

InputXOR resultWhy
=XOR(1,0)TRUEOne TRUE (odd) → TRUE
=XOR(1,1)FALSETwo TRUE (even) → FALSE
=XOR(2,2,2)TRUEThree non-zero (odd) → TRUE
=XOR(TRUE,TRUE,TRUE)TRUEOdd count → TRUE, NOT "exactly one"
=XOR(TRUE,TRUE,TRUE,TRUE)FALSEEven count → FALSE
=XOR(E2:E5) (all blank)FALSEZero TRUE (even) → FALSE
⚠ The eager-evaluation trap. XOR evaluates every argument before deciding — so one failing argument errors the whole formula even when the result is already determined. IF is different: it is lazy.
InputResultWhy
=XOR(TRUE,1/0)#DIV/0!Even though the answer is already decided, the 1/0 still errors the whole formula
=IF(FALSE,1/0,5)5IF is lazy: the untaken branch is never evaluated
=IFERROR(XOR(TRUE,1/0),"safe")safeWrap the whole call to absorb the error

XOR is parity, not "exactly one"

The biggest XOR surprise: it returns TRUE when an odd number of inputs are TRUE — not when exactly one is. Measured across 2, 3 and 4 inputs:

FormulaTRUE countResult
=XOR(TRUE,FALSE)1 (odd)TRUE
=XOR(TRUE,TRUE)2 (even)FALSE
=XOR(TRUE,TRUE,TRUE)3 (odd)TRUE
=XOR(TRUE,TRUE,TRUE,TRUE)4 (even)FALSE
Need "exactly one"? XOR will not do it for 3+ inputs. Use =COUNTIF(range,TRUE)=1 or =SUMPRODUCT(--(range))=1 instead.
// 03 — Try it live

Interactive XOR playground

Edit the table or type any formula — the HyperFormula engine evaluates it instantly. Load a preset to see XOR return TRUE/FALSE, coerce numbers and text, and hit the eager-evaluation trap in real time.

A1Sample data — click any cell to edit, the formula re-evaluates live
Result
—
✓ readyHyperFormula 3.5
// 04 — Error library

The real-world error library

8 failure patterns mined from actual user reports on Reddit, Stack Overflow and Super User — each with the authentic symptom, root cause, a fix, and a runnable formula. Not textbook theory.

// 05 — Cross-platform

Where XOR works

XOR is available across modern Excel, Google Sheets and LibreOffice. XOR arrived in Excel 2013, so 2010 and earlier return #NAME? — here is the MOD/SUMPRODUCT fallback.

PlatformSupportNotesGotcha
✓ Supported full XOR◐ Partial works with caveatsCompiled from public docs · verify against your build
// Go deeper

Master logical logic

XOR is parity. The full course walks the logical toolkit end to end — AND/OR/XOR/NOT, the "exactly one" pattern, and the eager-evaluation trap.

  • AND · OR · XOR · NOT — choosing the right combiner
  • XOR parity vs "exactly one" (COUNTIF=1)
  • Coercion and the eager-evaluation trap
  • Backward compatibility: MOD(SUMPRODUCT(...),2)
Free while in beta
Browse the function library

No account needed. Every page has a live playground.

// 07 — FAQ

Frequently asked