Skip to content

Excel function guide · Logic

AND and OR functions in Excel

AND returns TRUE only when every condition is true; OR returns TRUE when at least one is. They are usually placed inside IF to turn several tests into one decision, such as "rating 3 or more and at least a year of service".

Syntax

=AND(logical1, [logical2], …)
=OR(logical1, [logical2], …)
=IF(AND(test1, test2), "Yes", "No")
ArgumentRequired?What it means
logical1RequiredThe first condition, such as B2>=3.
logical2, …OptionalMore conditions. AND needs all of them TRUE; OR needs at least one.

AND and OR examples

Every example uses this small table. The results are what Excel shows in the cell.

ABCD
1NameRatingYearsAbsences
2Amira432
3Ben30.50
4Chen567
5Dana241
6Elif324
  1. 1. Every condition

    =AND(B2>=3, C2>=1)

    Result: TRUE

    Amira's rating is 4 and she has 3 years' service, so both tests pass.

  2. 2. Any condition

    =OR(B5<=2, D5>=5)

    Result: TRUE

    Dana has only 1 absence, but her rating of 2 is enough for OR.

  3. 3. Inside IF

    =IF(AND(B3>=3, C3>=1), "Eligible", "Not eligible")

    Result: Not eligible

    Ben's rating qualifies but half a year of service doesn't, and AND needs both.

Try it now

Practise AND and OR in a live sheet.

Type each formula yourself. Answers are checked by the same engine as the full course. No account needed.

Try it · AND and OR
0 XP
E2
A
B
C
D
E
F
1
Name
Rating
Years
Absences
Eligible
Flag
2
Amira
4
3
2
3
Ben
3
0.5
0
4
Chen
5
6
7
5
Dana
2
4
1
6
Elif
3
2
4
7
8
Double-click or start typing to edit

Step 1 of 3

In E2, use AND to return TRUE if the rating is at least 3 and years are at least 1.

Common AND and OR mistakes

Practise this in Excel Quest

AND, OR & IFERROR Members

Course 4 · Logic & Error Handling · 12 min

Combine conditions into real hiring rules and handle errors gracefully.

This lesson is included in Formula Quest memberships. A free account starts you on the free lessons of the Excel Quest curriculum.

Related functions

All Excel function guides