What you will learn
- Return a number from IF
- Do math inside IF
How it works
=IF(B2>=50,0,5) gives 0 if the price is $50 or more, otherwise 5.
You can put math in the answers too: =IF(B2>=50,B2*10%,0).
Formulas at a glance
=IF(B2>=50,0,5) | free shipping over $50 |
=IF(B2>=50,B2*10%,0) | 10% reward |
Example
Write the formula to give free shipping (0) if order A costs $50 or more. Otherwise shipping is 5.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Order | Price | Shipping | Total | Reward |
| 2 | A | $35.00 | |||
| 3 | B | $60.00 | |||
| 4 | C | $50.00 | |||
| 5 | D | $12.00 | |||
| 6 | E | $85.00 |
Click C2 and type =IF(B2>=50,0,5), then press Enter.
The answer is $5.00.
When to use it
- Free shipping over a set amount
- A discount or bonus only above a target
- Different rates for different levels
Common mistakes
- Putting numbers in quotes"5" is text. Write 5 so you can add it up later.
- Writing 10% as 10Use 10% or 0.1 in the formula.
- Mixing up the true and false partsThe answer if true comes first.
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.