IF + AND: two conditions at once

Lesson 9 of 54

Put AND inside IF to require several conditions at once: =IF(AND(test1, test2), value_if_true, value_if_false). The result is "true" only when every test passes.

A salesperson earns a bonus when Sales are over 10000 AND Rating is at least 4. In cell D2, write a formula that shows "Bonus" or "No bonus".

D2
ABCD
1NameSalesRatingBonus?
2Ana12,5005
3Luis14,2003
4Marta9,8005
5Jorge10,1004

Type in the formula bar above and press Enter to check.

Skip

How IF with AND works

Syntax

=IF(AND(test1, test2, ...), value_if_true, value_if_false)
AND(test1, test2, ...)
TRUE only if all the tests are TRUE. You can list up to 255 tests.
value_if_true
What to show when every test passes.
value_if_false
What to show when at least one test fails.

Example

A loan is approved when the credit score in B2 is at least 700 and the income in C2 is over 50,000.

=IF(AND(B2>=700, C2>50000), "Approved", "Review")

Shows "Approved" only when both are true; anything else goes to "Review".

Common mistakes

  • Writing the conditions straight into IF: =IF(B2>=700, C2>50000, ...) treats the second test as the "true" value.
  • Using AND when either condition should be enough. That is OR.
  • Testing a range between two numbers as 10<B2<20. Write AND(B2>10, B2<20).

Questions people ask

What is the difference between AND and OR in IF?

AND needs every condition to be true; OR needs just one.

Can I combine AND and OR?

Yes: =IF(AND(A2="Yes", OR(B2>100, C2="VIP")), "OK", "No").

Practice it above: type the formula in the formula bar and press Enter to check.