AND and OR in Excel: Combine Conditions in IF
Use AND and OR in Excel to test several conditions at once, inside IF or alone. Clear examples for bonuses, approvals and flags, plus NOT and common mistakes.
By Ayoub Farid · · 1 min read
AND and OR let one test check several things. On their own they return TRUE or FALSE. Inside IF, they let you make decisions like "bonus only if sales are high AND returns are low".
AND: all must be true
=AND(B2>=5000, C2<200)
TRUE only if sales are at least 5,000 and returns are under 200.
OR: at least one must be true
=OR(D2="Late", E2="Damaged")
TRUE if either problem is present.
Inside IF
=IF(AND(B2>=5000,C2<200),"Bonus","No bonus")
=IF(OR(D2="Late",E2="Damaged"),"Review","OK")
Combining AND and OR
Approve if the amount is under 1,000, or if it's over 1,000 and a manager signed:
=IF(OR(B2<1000,AND(B2>=1000,C2="Yes")),"Approved","Needs sign-off")
Write the logic in words first, then translate. Brackets keep it readable.
NOT: flip a result
=IF(NOT(C2="Paid"),"Chase","")
Often <> is simpler: =IF(C2<>"Paid","Chase","").
Checking a value is between two numbers
=AND(B2>=18, B2<=65)
There's no BETWEEN function in Excel, so AND with two comparisons is the standard way.
Common mistakes
- Writing it like English:
=IF(B2>10 AND B2<20, ...)doesn't work. UseAND(B2>10,B2<20). - Comparing one cell to several values the long way:
=OR(C2="A",C2="B",C2="C")works, but for long lists use=ISNUMBER(MATCH(C2,{"A","B","C"},0))or a lookup list. - Text without quotes gives
#NAME?.
Counting with several conditions
To count or sum rows where several conditions are true, you don't need AND in each row. COUNTIFS and SUMIFS treat each condition as AND automatically.
Practise it
AND and OR are part of the upcoming "Decisions" unit in Cellio. Meanwhile, the practice exercises include IF tasks you can try.
Frequently asked questions
How do I use AND and OR together in Excel?
Nest them, e.g. =OR(A2="VIP",AND(B2>100,C2="Yes")), and wrap in IF to return custom text.
How do I check if a number is between two values?
=AND(B2>=10,B2<=20) returns TRUE when B2 is between 10 and 20 inclusive.
Can AND take more than two conditions?
Yes, up to 255 conditions separated by commas.
Do AND and OR work in Google Sheets?
Yes, identically.