Skip to content

IF with AND and OR in Excel: Multiple Conditions (Tested Examples)

  • by

Quick answer: Put AND or OR inside the first part of IF.

  • All conditions must be true: =IF(AND(B2>=100,C2="Yes"),"Bonus","No")
  • Any one condition is enough: =IF(OR(D2="East",D2="West"),"Priority","Standard")
  • Both together: =IF(AND(C2="Yes",OR(D2="East",D2="North")),"Yes","")

AND and OR always go in front of the conditions, with the conditions inside the brackets, separated by commas.

Tested in Excel for Microsoft 365 on Windows 11, November 2026. All results below are from that test sheet.


The sample data

Five salespeople with Sales, Training (Yes/No) and Region. Each column E to K holds one formula, copied down.

IF with AND: all conditions must be true

Give a bonus only if sales are at least 100 and training is done:

=IF(AND(B2>=100,C2="Yes"),"Bonus","No")

Excel IF AND formula returning Bonus only when sales are at least 100 and training is Yes

Ana (120, Yes) and Eli (105, Yes) get Bonus. Cara has 150 sales but no training, so she gets No.

IF with OR: any condition is enough

Mark East or West customers as priority:

=IF(OR(D2="East",D2="West"),"Priority","Standard")

Excel IF OR formula returning Priority for East or West regions

Text tests like D2="East" are not case-sensitive, so “east” also matches.

IF with AND and OR together

Trained staff in East or North only:

=IF(AND(C2="Yes",OR(D2="East",D2="North")),"Yes","")

Excel formula with OR nested inside AND inside IF, returning Yes for Ana and Eli

Read it from the inside out: OR checks the region, then AND checks that both training and region pass. The "" at the end leaves the cell blank when the test fails.

IF between two values

To check whether sales are between 90 and 120 (inclusive):

=IF(AND(B2>=90,B2<=120),"In range","Out")

Excel IF AND formula testing whether sales are between 90 and 120

Use > and < instead if 90 and 120 themselves should not count.

The “between” mistake most people make

This looks right, but it is wrong:

=IF(90<=B2<=120,"In range","Out")

Wrong Excel formula 90<=B2<=120 returning Out for every row

In our test it returned Out for every row, even for 90 and 120. Excel doesn’t read it as maths does. It works out 90<=B2 first (TRUE or FALSE), then compares that TRUE or FALSE with 120. Excel ranks TRUE and FALSE above any number, so the second test is always FALSE. Excel gives no error, which makes this mistake easy to miss. Always use AND.

Shortcut: OR with a list of values

Instead of repeating D2= for every value, give OR a list in curly brackets:

=IF(OR(D2={"East","West"}),"Priority","Standard")

Excel IF OR formula using an array constant of regions, matching the longer OR formula

It gave exactly the same results as the longer OR formula. Add more values inside the braces: {"East","West","South"}.

More than two outcomes: IFS

AND and OR give two outcomes (true or false). For tiers, use IFS, which stops at the first test that is true:

=IFS(B2>=150,"Gold",B2>=100,"Silver",TRUE,"Bronze")

Excel IFS formula giving Gold, Silver or Bronze tiers based on sales

  • Put the highest limit first, or everyone above 100 becomes Silver.
  • TRUE as the last test means “everything else”.
  • IFS is in Excel 2019 and Microsoft 365. In older versions, nest IFs: =IF(B2>=150,"Gold",IF(B2>=100,"Silver","Bronze")).

You can also put AND or OR inside any IFS test, for example IFS(AND(B2>=100,C2="Yes"),"Bonus",TRUE,"No").

AND, OR and NOT at a glance

FunctionReturns TRUE whenExample
ANDEvery condition is trueAND(B2>=100,C2="Yes")
ORAt least one condition is trueOR(D2="East",D2="West")
NOTThe condition is falseNOT(C2="Yes"), same as C2<>"Yes"

AND and OR each accept up to 255 conditions.

Common mistakes

MistakeFix
=IF(B2>=100 AND C2="Yes",…)AND goes in front: IF(AND(B2>=100,C2="Yes"),…)
=IF(90<=B2<=120,…)Use AND(B2>=90,B2<=120)
Text without quotes, e.g. C2=YesText needs quotes: C2="Yes" (you’ll see #NAME?)
Numbers stored as text"100" is not 100. Remove the quotes around numbers
IFS tiers in the wrong orderStart with the highest limit

FAQ

How do I use IF with AND in Excel?
=IF(AND(condition1,condition2),value_if_true,value_if_false). Example: =IF(AND(B2>=100,C2=”Yes”),”Bonus”,”No”).

How do I use IF with OR in Excel?
=IF(OR(condition1,condition2),value_if_true,value_if_false). Example: =IF(OR(D2=”East”,D2=”West”),”Priority”,”Standard”).

Can I use AND and OR in the same IF formula?
Yes. Nest one inside the other, for example =IF(AND(C2=”Yes”,OR(D2=”East”,D2=”North”)),”Yes”,””).

How do I write an IF formula for a value between two numbers?
=IF(AND(B2>=90,B2<=120),”In range”,”Out”). Don’t write 90<=B2<=120; Excel returns the wrong answer without an error.

How do I write an IF formula with 3 conditions?
Add a third condition inside AND or OR, such as AND(B2>=100,C2=”Yes”,D2=”East”). For 3 different results, use IFS or nested IFs.

Is the IF function case-sensitive?
No. “yes” and “Yes” match. Use EXACT inside the test if you need a case-sensitive match.


Related tutorials

Leave a Reply

Your email address will not be published. Required fields are marked *