
📎 This article includes 1 downloadable practice file ↓
In this article
XOR returns TRUE when an odd number of conditions are TRUE — with two conditions, “one or the other but not both”.
Syntax
=XOR(logical1, [logical2], ...)
| Argument | What it means |
|---|---|
logical1… |
Conditions. |
Examples
Example 1
=XOR(C2="Paid", D2<>"")
Flag inconsistent rows: marked Paid but no payment date, or a date but not marked Paid.
XOR in practice
Where you will use it
- Exactly one of two conditions true
- Toggle logic
- Find mismatches between two checks
Worked example
| Paid online | Paid cash | Formula | Result |
|---|---|---|---|
| TRUE | FALSE | =XOR(A2,B2) | TRUE |
| TRUE | TRUE | =XOR(A3,B3) | FALSE |
| FALSE | FALSE | =XOR(A4,B4) | FALSE |
Results calculated in Excel.
Mistakes people make
| Mistake | What to do instead |
|---|---|
| Many inputs | XOR is TRUE when an odd number are TRUE |
| Expecting OR | Both TRUE gives FALSE |
Related functions
📚 Part of the free Excel course: Beginner → Expert · Try it in the Formula Lab or ask the AI Helper.
Test formulas dynamically in our web formula laboratory or download the companion Excel workbook.
📎 Practice files for this article
- 📗Practice workbook: Logic, LET & LAMBDA17 tasks on realistic sales data — type your formula, the Check column turns green when it is right. Answers sheet included.⬇ XLSX · 35 KB
Free to use for learning. Files with macros (.bas) are plain text — import them with Alt+F11 → File → Import File, and always test on a copy.
Atul (AJ) builds office-automation and local-first AI tools as Atulya AI, and works with Excel, SAP and Oracle EPM every day. He writes about the shortcuts, macros and automations that actually save time — plus the occasional wacky fact. Videos on YouTube: Lazy Automator AI (@LazyAutomatorAI).
More posts by Atul →Build this skill next
This page is a quick function reference. Use it for syntax, then practise the function in a broader workflow.
Stuck on a step? Ask a question and the AI answers using this article.