AND
AND and OR inside IF
Module 3 of 12 Spreadsheet in your browser
Lesson concept What you'll do
1 / 7Decide who gets a bonus, when it needs two things at once.
AND is TRUE only if every test passes; OR if any one does. Put it inside IF.
On your own New data, same idea
Who gets a bonus? Show "Yes" in D2:D8 if sales are at least 500 and the person has worked here for at least 2 years, otherwise "No". Write one formula in D2 and copy it down.
Typing formulas is easiest on a computer with a keyboard.
A1
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Name | Sales | Years | Bonus? | |
| 2 | Tariq | 690 | 2 | ||
| 3 | Nadia | 500 | 5 | ||
| 4 | Daniel | 410 | 0 | ||
| 5 | Quinn | 490 | 4 | ||
| 6 | Jamal | 200 | 5 | ||
| 7 | Isla | 710 | 1 | ||
| 8 | Kofi | 590 | 8 | ||
| 9 | |||||
| 10 | |||||
| 11 | |||||
| 12 |
Type to enter a value or a formula starting with =. F2 edits, F4 adds $ to a reference.
How AND and OR and IF works
What do
ANDandORdo?They combine several yes-or-no questions into one:
AND(B2>=500,C2>=2)isTRUEonly when every question isTRUE.OR(B2>=500,C2>=2)isTRUEwhen at least one question isTRUE.
How do you use them inside
IF?On their own they show
TRUEorFALSE. Put one insideIFas the question to show something more useful:=IF(AND(B2>=500,C2>=2), "Yes", "No")
Know someone fighting with a spreadsheet? Send them this page.