Logical Functions
Intermediate

SWITCH for text codes, with a default

Turn a one-letter code into a word, and say so when the code is unknown.

Task:

The despatch export uses one-letter codes for the shipping method: A for Air, S for Sea, R for Road. In C2:C7 show the method name, or Check code for anything else.

Interactive Spreadsheet

Hints

+5 XPno-hints bonus

Solve it on your own to keep the bonus. Each hint gets one step closer to the formula.

The data in this exercise

This is the grid you start with. Cell references in the task — B6, C2 — point at the row numbers and column letters below.

7 rows × 3 columns6 cells you fill in
ABC
1ShipmentCodeMethod
2SH-801A
3SH-802R
4SH-803S
5SH-804X
6SH-805R
7SH-806a
What this exercise teachesMay contain the answer

SWITCH compares one value against a list, so it is shorter than IFS when every test is "equals". The default catches the X — a typo or a new method nobody told you about. Text matching is not case-sensitive, so a lower-case a still reads as Air.