Learn Excel
EN
Sets how numbers, dates and formulas look, so everything works just like your own Excel.

Home › Excel functions › AND, OR & NOT

AND, OR and NOT in Excel: Combine Conditions

AND, OR and NOT combine conditions into a single TRUE or FALSE. On their own they're rarely the final answer, but inside IF, filters and conditional formatting they're essential.

In this guide
  1. Syntax
  2. Example
  3. Try it yourself
  4. Inside IF
  5. NOT
  6. Formatting and filtering
  7. In practice: free shipping and a member discount
  8. Keep learning
  9. FAQ

Syntax

FunctionSyntaxReturns TRUE when
AND=AND(logical1, [logical2], …)All conditions are true
OR=OR(logical1, [logical2], …)At least one condition is true
NOT=NOT(logical)The condition is false

Comparison operators: what to type

TypeMeans
=is equal to
>greater than
<less than
>=greater than or equal to: first >, then =
<=less than or equal to: first <, then =
<>not equal to: first <, then >

Always two separate keys, never a special symbol.

Example

ABCDE
1StudentScoreAssignmentANDOR
2Anna72YesTRUETRUE
3Ben55YesFALSETRUE
4Chris90NoFALSETRUE
5Dana41NoFALSEFALSE
  • Column D: =AND(B2>=60, C2="Yes"). Only Anna meets both conditions.
  • Column E: =OR(B2>=60, C2="Yes"). Everyone except Dana meets at least one.

AND, OR & NOT practice: try it yourself

Reading is one thing, typing it is another. Build the formula below step by step: the tips tell you what to type next, and you can click or drag across cells to add them, just like in Excel.

Task: Check in D2 if the customer is 18 or older AND has agreed to the terms: =AND(B2>=18,C2="Yes")

Inside IF

Put AND or OR in the first argument of IF to return text instead of TRUE/FALSE:

=IF(AND(B2>=60, C2="Yes"), "Pass", "Fail") =IF(OR(B2="VIP", C2>1000), "Free shipping", "")

A range check: is a value between 10 and 20? =AND(A2>=10, A2<=20). Note that Excel doesn't understand 10<=A2<=20; you always need AND.

NOT

NOT reverses a result. It's most useful with functions that return TRUE/FALSE:

  • =NOT(ISBLANK(A2)): TRUE when A2 is filled in.
  • =IF(NOT(ISNUMBER(SEARCH("test", A2))), "Real order", "Test")

Often <> is simpler: =A2<>"Done" instead of =NOT(A2="Done").

In conditional formatting and FILTER

  • Conditional formatting rule: =AND($D2<TODAY(), $E2<>"Done") highlights overdue open tasks.
  • FILTER doesn't accept AND/OR on ranges; use * for AND and + for OR instead: =FILTER(A2:C10, (B2:B10>=60)*(C2:C10="Yes")).

In practice: free shipping and a member discount

A web shop gives free shipping when the order is at least 50 or the customer is a member. Members also get 10% off, but only on orders of 100 or more: that is an and.

ABCDE
1OrderAmountMemberShippingDiscount
2100162NoFree0
3100235YesFree0
4100328NoPaid0
51004120YesFree12
  • D2: =IF(OR(B2>=50, C2="Yes"), "Free", "Paid")
  • E2: =IF(AND(B2>=100, C2="Yes"), B2*0.1, 0)

OR is enough for shipping: one of the two conditions has to be true. Only order 1003 pays. The discount needs AND: both conditions at once, so only order 1004 gets 12 off.

Frequently asked questions

How many conditions can AND and OR take?

Up to 255 conditions each.

Why does AND return #VALUE!?

None of the arguments produce TRUE or FALSE, for example when you refer to cells with text. Make sure each argument is a comparison.

What is XOR?

XOR ("exclusive or") returns TRUE when an odd number of conditions is true; with two conditions, when exactly one of them is true.