Practice by topic / Excel / Conditional Logic

SWITCH and IS Functions Exercises

IF-style formulas let a spreadsheet make decisions — pass or fail, on time or late, which rate applies — so you don't have to check each row by hand. These 10 exercises build up step by step, starting with region code to name, add a default, priority label.

3 of 10 free · no sign-up needed · graded on the formula you write

All 10 SWITCH and IS Functions exercises

1

Region Code to Name

Free

A2 holds a one-letter region code: N, S, E or W. Write a formula in B2 that returns the full region name using SWITCH.

AB
1CodeRegion
2S?
Show the solution

SWITCH takes the value, then value/result pairs. Use =SWITCH(A2,"N","North","S","South","E","East","W","West")

Right — SWITCH lists each value and its result, which reads more easily than four nested IFs.

Expected result in B2: South

Try it in the live spreadsheet →
2

Add a Default

Free

A2 holds a finishing place. Write a formula in B2 that returns Gold, Silver or Bronze for places 1 to 3, and 'No medal' for anything else.

AB
1PlaceMedal
24?
Show the solution

Put the default result last, on its own. Use =SWITCH(A2,1,"Gold",2,"Silver",3,"Bronze","No medal")

Good — a last argument with no pair is SWITCH's default.

Expected result in B2: No medal

Try it in the live spreadsheet →
3

Priority Label

Free

A2 holds a ticket priority from 1 to 3. Write a formula in B2 that returns Urgent for 1, High for 2 and Normal for 3.

AB
1PriorityLabel
22?
Show the solution

Pair each number with its label. Use =SWITCH(A2,1,"Urgent",2,"High",3,"Normal")

Right — one SWITCH replaces a chain of IFs.

Expected result in B2: High

Try it in the live spreadsheet →
4

Bands With SWITCH(TRUE)

A2 holds a score. Write a formula in B2 using SWITCH that returns High for 80 and above, Medium for 50 to 79, and Low otherwise.

AB
1ScoreBand
264?

Solution and instant grading: open it in the practice app (use one of your 20 free picks, or Pro).

Try it in the live spreadsheet →
6

Spot a Number Stored as Text

A2 looks like 1200, but it came from a CSV file. Write a formula in B2 that returns 'Text' if A2 is stored as text, otherwise 'Number'.

AB
1AmountStored as
21200?

Solution and instant grading: open it in the practice app (use one of your 20 free picks, or Pro).

Try it in the live spreadsheet →
7

Divide Only When You Can

A2 holds a total cost and B2 the number of units, which sometimes says 'n/a'. Write a formula in C2 that divides A2 by B2 when B2 is a number, otherwise returns 'Check B2'.

ABC
1TotalUnitsPer unit
2900n/a?

Solution and instant grading: open it in the practice app (use one of your 20 free picks, or Pro).

Try it in the live spreadsheet →
8

Does the Name Contain Ltd?

A2 holds a customer name. Write a formula in B2 that returns 'Company' if the name contains 'Ltd', otherwise 'Person'.

AB
1CustomerType
2Tan Brothers Pte Ltd?

Solution and instant grading: open it in the practice app (use one of your 20 free picks, or Pro).

Try it in the live spreadsheet →
9

Is the Code on the Approved List?

A2 holds an item code and D2:D5 the approved list. Write a formula in B2 that returns 'Approved' if the code is on the list, otherwise 'Not approved'.

ABCD
1ItemStatusApproved
2SKU-207?SKU-101
3SKU-207
4SKU-310
5SKU-415

Solution and instant grading: open it in the practice app (use one of your 20 free picks, or Pro).

Try it in the live spreadsheet →