NOT vs XOR Function in Excel + Tips (Video in Khmer)
Learn how to use NOT and XOR logical functions in Excel step-by-step with simple examples and video tutorial.
Hello everyone! Today i will show you how to use NOT and XOR logical functions in Microsoft Excel step by step. XOR function available in Excel 2013 and newer, Excel 365, and Excel for Web.
1. What is NOT and XOR Function?
- NOT: Reverses a logical condition. It turns
TRUEintoFALSE, andFALSEintoTRUE. - XOR (Exclusive OR): Returns
TRUEwhen an odd number of conditions are TRUE. For 2 conditions, it means one OR the other is true, but NOT BOTH!
Think of them like simple logic switches:
NOT(A2 > 50): "Is A2 NOT greater than 50?"XOR(A2="Pass", B2="Pass"): "Did the student pass ONLY 1 subject? (Not both subjects and not zero subjects)".
2. 🛠️ Formula Syntax & Parameters
=NOT(logical)
=XOR(logical1, [logical2], ...)
logical: Required. A condition or expression that evaluates toTRUEorFALSE(e.g.,A2 > 100).[logical2], ...: Optional forXOR. Additional conditions to test (up to 255 conditions).
3. 📋 Practical Examples
Example Data Table (A2:C5)
| Row | Column A (Student) | Column B (Exam 1) | Column C (Exam 2) |
|---|---|---|---|
| 2 | John | Pass | Fail |
| 3 | Alex | Pass | Pass |
| 4 | Sara | Fail | Fail |
| 5 | David | Fail | Pass |
Example 1: Reverse Condition with NOT Function
Suppose you want to check if a student did NOT pass Exam 1:
=NOT(B2 = "Pass")
👉 Result:
- John (
Pass) ➔FALSE - Sara (
Fail) ➔TRUE
Example 2: Exclusive OR with XOR Function (Exactly One Condition TRUE)
Suppose a student gets a bonus if they passed ONLY ONE exam (re-test needed if 1 pass, no re-test if both pass or both fail):
=XOR(B2 = "Pass", C2 = "Pass")
👉 Result Truth Table:
- John (
Pass,Fail): 1 condition TRUE ➔TRUE(Gets re-test!) - Alex (
Pass,Pass): 2 conditions TRUE (Even) ➔FALSE(Passed both!) - Sara (
Fail,Fail): 0 conditions TRUE (Even) ➔FALSE(Failed both!) - David (
Fail,Pass): 1 condition TRUE ➔TRUE(Gets re-test!)
Example 3: Combine IF with NOT & XOR
Wrap NOT or XOR inside an IF statement to display custom messages:
=IF(XOR(B2="Pass", C2="Pass"), "Needs Re-Exam", "Finalized")
👉 Result: Displays "Needs Re-Exam" for students who passed exactly 1 exam!
💡 Quick Tips for NOT and XOR Functions
- Difference Between
ORvsXOR:OR(TRUE, TRUE)returnsTRUE(at least one is true).XOR(TRUE, TRUE)returnsFALSE(exclusive OR means only ONE can be true!).
NOTReverses Logical Values: UseNOTwhen it's easier to write the opposite condition. For example,=NOT(ISBLANK(A2))checks if cellA2is NOT empty!- XOR Works with Numbers: Non-zero numbers evaluate to
TRUE, and0evaluates toFALSE. So=NOT(0)returnsTRUE. - Excel Version Requirement:
NOTworks in all Excel versions.XORrequires Excel 2013 or newer, Excel 365, or Excel for Web.
📚 Related Resources & Tutorials
Related Tutorials
Opens in new tab ↗MAX vs MAXIFS vs LARGE Function in Excel + Tips (Video in Khmer)
Learn how to use MAX, MAXIFS, and LARGE functions in Excel step-by-step to find highest values and Nth largest rank with simple examples and video tutorial.
MAX vs MAXIFS Function in Excel + Tips (Video in Khmer)
Learn how to use MAX and MAXIFS function in Excel step by step to find maximum value with criteria with simple examples and video tutorial.
TOCOL vs TOROW in Excel + Tips
Learn how to convert 2D array into a single column or single row in Excel step-by-step with simple examples and tips.