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")
| Argument | Required? | What it means |
|---|---|---|
| logical1 | Required | The first condition, such as B2>=3. |
| logical2, … | Optional | More 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.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Name | Rating | Years | Absences |
| 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 |
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. Any condition
=OR(B5<=2, D5>=5)
Result: TRUE
Dana has only 1 absence, but her rating of 2 is enough for OR.
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.
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
Writing AND between tests
=IF(B2>=3 AND C2>=1, …) isn't valid in Excel. The tests go inside the function: AND(B2>=3, C2>=1).
Chained comparisons
3<=B2<=5 doesn't test a range in Excel. Write AND(B2>=3, B2<=5).
Expecting a label
AND and OR return TRUE or FALSE. Wrap them in IF to show words such as Eligible or Review.
Mixing AND with OR
Nest them to say exactly what you mean: AND(B2>=3, OR(C2>=2, D2=0)) means a good rating plus either long service or no absences.
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.