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.

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

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 TRUE into FALSE, and FALSE into TRUE.
  • XOR (Exclusive OR): Returns TRUE when 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 to TRUE or FALSE (e.g., A2 > 100).
  • [logical2], ...: Optional for XOR. Additional conditions to test (up to 255 conditions).
Advertisement

3. 📋 Practical Examples

Example Data Table (A2:C5)

RowColumn A (Student)Column B (Exam 1)Column C (Exam 2)
2JohnPassFail
3AlexPassPass
4SaraFailFail
5DavidFailPass

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

  1. Difference Between OR vs XOR:
    • OR(TRUE, TRUE) returns TRUE (at least one is true).
    • XOR(TRUE, TRUE) returns FALSE (exclusive OR means only ONE can be true!).
  2. NOT Reverses Logical Values: Use NOT when it's easier to write the opposite condition. For example, =NOT(ISBLANK(A2)) checks if cell A2 is NOT empty!
  3. XOR Works with Numbers: Non-zero numbers evaluate to TRUE, and 0 evaluates to FALSE. So =NOT(0) returns TRUE.
  4. Excel Version Requirement: NOT works in all Excel versions. XOR requires Excel 2013 or newer, Excel 365, or Excel for Web.

📚 Related Resources & Tutorials

Found this tutorial helpful? Share it with colleagues:
📚

Related Tutorials

Opens in new tab ↗
Advertisement