ExcelUnpackUnpack Excel, one formula at a time.
Log inSign up

Lesson 31 · Logic

AND and OR in Excel

AND is true only when every test is true. OR is true when at least one test is true. Put them inside IF to get a clear answer like "Yes" or "No".

Practice this lesson →Pro lesson. The first 4 lessons are free.

What you will learn

  • Check two things at once with AND and OR
  • Use them inside IF

How it works

AND means all the tests must be true.

OR means at least one test must be true.

Put them inside IF to get a clear answer like "Yes" or "No".

Formulas at a glance

=AND(cond1, cond2)all must be true
=OR(cond1, cond2)any can be true
=IF(AND(B2>=2,C2>=4),"Yes","No")The pattern to follow

Example

Write the formula to show "Yes" if Ana has 2 or more Years AND a Rating of 4 or more. Otherwise show "No".

ABCDE
1EmployeeYearsRatingBonus?Review?
2Ana34.5
3Ben13.8
4Cleo62.9
5Dev0.54.2
6Eli24
7Fay43.1

Click D2 and type =IF(AND(B2>=2,C2>=4),"Yes","No"), then press Enter.

The answer is Yes.

When to use it

  • Bonus only if sales and attendance are both high
  • Weekend if the day is Saturday or Sunday
  • Any choice that depends on more than one test

Common mistakes

  • Writing B2>=2 AND C2>=4Excel needs the function form: AND(B2>=2,C2>=4).
  • Mixing up AND and ORAND = all must be true. OR = any one is enough.
  • Forgetting to put it inside IFOn its own, AND shows TRUE or FALSE.

Quick check

What does =AND(TRUE, FALSE) give?

  1. TRUE
  2. FALSE
  3. #VALUE!
  4. 1
Show the answer

B. FALSE AND needs every test to be true.

Practice it on a real sheet

Reading is a start. Doing it is how it sticks. This lesson walks you through every click on a live spreadsheet and checks each answer.

AND and OR in Excel: how it works, with examples · ExcelUnpack