Spreadsheet Practice

How to check if exactly one of two conditions is true in Excel

Formula (Excel and Google Sheets)

=IF(XOR(B2="Approve",C2="Approve"),"Third review","Decided")

Use XOR, which is TRUE when one test is true but not both: =IF(XOR(B2="Approve",C2="Approve"),"Third review","Decided").

Result on the example
one result per row in D2, filled down to D7
Works in
Excel 2013 and later
Google Sheets
Same formula

See it work

The formula is already in D2, filled down to D7. Change any input and the result updates, or edit the formula to experiment.

How it works

XOR (exclusive or) returns TRUE when exactly one of two tests is TRUE, and FALSE when both are TRUE or both are FALSE. Here that singles out the split decisions. OR would also flag the rows where both reviewers approved.

=IF(XOR(B2="Approve",C2="Approve"),"Third review","Decided")

Result"Decided"

  1. B2"Approve"

    The value in B2.

  2. B2="Approve"TRUE

    The = operator tests whether the two sides are equal.

  3. C2"Approve"

    The value in C2.

  4. C2="Approve"TRUE

    The = operator tests whether the two sides are equal.

  5. XOR(B2="Approve",C2="Approve")FALSE

    XOR: TRUE if an odd number of arguments are true.

    • logical1B2="Approve"TRUE
    • logical2C2="Approve"TRUE
  6. IF(XOR(B2="Approve",C2="Approve"),"Third review","Decided")"Decided"

    IF: Returns one value if a test is true, another if false.

    • logical_testXOR(B2="Approve",C2="Approve")FALSE
    • value_if_true"Third review"not used
    • value_if_false"Decided"

In Google Sheets

The same formula works in Google Sheets: =IF(XOR(B2="Approve",C2="Approve"),"Third review","Decided"). We ran it in Google Sheets mode on the same data and it returns the same results.

Other ways to do it

Each one was run on the same example sheet.

FormulaResultWhen to use it
=IF(B2<>C2,"Third review","Decided")Decided, Third review, Decided…With two reviewers and two possible answers, "they disagree" is the same test. XOR is clearer when the two conditions are different questions.
=IF((B2="Approve")+(C2="Approve")=1,"Third review","Decided")Decided, Third review, Decided…Adding the tests counts how many are TRUE. "=1" means exactly one, and it extends to three or more conditions.

Common mistakes

  • With more than two conditions, XOR is TRUE when an odd number are TRUE (1 or 3), not "exactly one". Count the TRUEs instead.
  • XOR needs Excel 2013 or later. In older versions use the not-equal or counting version.

Try it yourself

Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.

Check if exactly one of two conditions is true

In D2, show "Third review" when exactly one reviewer approved, and "Decided" when they agree. Fill down to D7.

Questions

How do I check that exactly one of three cells says Yes?

Count them: =COUNTIF(B2:D2,"Yes")=1.

Does Google Sheets have XOR?

Yes, with the same behavior.

Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.