IF practice exercises

IF checks a condition and returns one value when it is true and another when it is false. It is the building block for flags, labels, bonuses and almost every "it depends" in a spreadsheet.

Syntax

IF(condition, value_if_true, value_if_false)
condition
A test that is TRUE or FALSE, like F2>=100 or B2="East".
value_if_true
What to return when the test is TRUE.
value_if_false
What to return when it is FALSE.

The practice data

An orders table: who sold what, where, and for how much. Every exercise below uses this sheet, and your answer goes in H2.

ABCDEF
1RepRegionProductUnitsPriceSales
2AnaEastWidget12560
3BenWestGadget520100
4CaraEastGadget820160
5DevNorthWidget205100
6AnaWestGizmo350150
7BenEastWidget7535
8CaraNorthGizmo250100
9DevEastGadget620120

Worked example

=IF(F3>=100,"Big","Small")

Row 3 has Sales of 100, so the result is "Big". Result:

Big

Your turn: 3 exercises

Type a formula and press Enter. It is checked by a real formula engine, so any correct approach counts.

1 Return Big if the Sales in F2 are 100 or more, otherwise Small.

H2

2 Return Bonus if the Units in D5 are more than 10, otherwise -.

H2

3 If the Region in B2 is East, return the Sales in F2 with 10% off (F2*0.9). Otherwise return F2 unchanged.

H2

Practice IF in the full lesson, free

Lesson 4 has more exercises in a real spreadsheet grid, with hints and progress tracking. No card needed.

Open lesson 4

Common IF mistakes

FAQ

How do I test two conditions in IF?

Use AND or OR inside the condition: =IF(AND(B2="East",F2>100),"Yes","No").

How do I leave the cell blank when false?

Use empty quotes: =IF(F2>100,"Big","").

Keep practicing