Cellgrids Cellgridsby LearnWithRinkesh
Home › Excel tutorials › How to Use IF with AND and OR in Excel

How to Use IF Function with AND/OR Conditions in Excel

By Rinkesh Shah · Business Analyst, 8 years in data · Updated 2026-10-30

▶ Video coming soon

The IF function returns one result if a test is true and another if it is false. AND and OR let you test more than one thing at once.

Basic IF

=IF(B2>=40, "Pass", "Fail")

IF with AND

AND is true only when all conditions are true. Bonus only if sales are above 50,000 and rating is at least 4:

=IF(AND(B2>50000, C2>=4), "Bonus", "No bonus")

IF with OR

OR is true when any condition is true. Free delivery if the order is large or the customer is a member:

=IF(OR(B2>=1000, C2="Member"), "Free", "Paid")

Nested IF

To test several outcomes, place an IF inside another:

=IF(B2>=85, "A", IF(B2>=70, "B", IF(B2>=55, "C", "D")))

Each IF needs its own closing bracket. Count them at the end.

A cleaner option: IFS

=IFS(B2>=85, "A", B2>=70, "B", B2>=55, "C", TRUE, "D")

IFS reads top to bottom and avoids the pile of brackets. Put TRUE last as the catch-all.

Tips

Frequently asked questions

How do I use IF with AND in Excel?

Put AND inside the IF test: =IF(AND(A2>50,B2="Yes"),"Pass","Fail"). The result is Pass only when both conditions are true.

What is the difference between AND and OR in Excel?

AND returns TRUE only if every condition is true. OR returns TRUE if at least one condition is true.

How many IFs can I nest in Excel?

Excel allows up to 64 nested IFs, but long chains are hard to read. IFS or a lookup table is usually cleaner.

Practice this online, free

Reading is only half of learning Excel. Cellgrids is a free place for online Excel practice: solve Excel formula exercises in a live spreadsheet, prepare for Excel interview questions, and work through business case studies built for data analytics and business analytics roles.

Practice these formulas: IF, AND, OR, IFS.

Start Excel practice → Case studies