Excel AND Practice Question: Years of service are in B2:B7 and the rating (1 to 5) in C2:C7. An employee…
The question
Years of service are in B2:B7 and the rating (1 to 5) in C2:C7. An employee gets a bonus only if they have at least 2 years of service AND a rating of 4 or more. Show Yes or No in E2:E7.
The data
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Employee | Years | Rating | Bonus | |
| 2 | Amit | 3 | 4 | ? | |
| 3 | Neha | 1 | 5 | ? | |
| 4 | Rahul | 5 | 3 | ? | |
| 5 | Priya | 2 | 5 | ? | |
| 6 | Karan | 4 | 4 | ? | |
| 7 | Sneha | 2 | 3 | ? |
The yellow cells are where your answer goes.
Show answer
Expected results:
- E2 = Yes
- E3 = No
- E4 = No
- E5 = Yes
- E6 = Yes
- E7 = No
How it works
Explanation: AND returns TRUE only when every condition is true. Wrapping it in IF turns the TRUE or FALSE into Yes or No.
Syntax: =IF(AND(B2>=2,C2>=4),"Yes","No")
Amit (3 years, rating 4) is Yes. Neha has 1 year, so No. Rahul has rating 3, so No.
Try it yourself in the live sheet
Type your formula in the highlighted cell and get instant feedback. Free, no Excel install needed.
Try this question in the live sheet →AND syntax
Returns TRUE only if every condition given is true. AND is used to build decision rules directly into a spreadsheet instead of manually judging each row. Full AND guide.
More AND practice questions
- A student passes only if both subject marks are 50 or more. Write Pass or Fail in D2 to…
- A person is eligible if the age is 18 or more and the city is Pune. Write Eligible or No…
- Give a Bonus only if the sales are 100000 or more and the rating is 90 or more,…
- Write Ship if the status is Paid, the quantity is above 0 and the stock is In stock.…
- Write Average if the marks are between 40 and 60 (both included), otherwise Other. Put…
- Multiply price and quantity only if both are valid numbers and the quantity is above 0.…
- A code is valid if it starts with HR, has exactly 7 characters and ends with 4 digits.…
- Write All passed in E2 if every mark in B2:B6 is 40 or more, otherwise Someone failed.
All practice questions · Excel exercises · Interview prep · Cheat sheet