| A | B | C | D | E | F | G | H | I | J | K | L | M | N | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Code | Size | ||||||||||||
| 2 | S | Small | ||||||||||||
| 3 | M | |||||||||||||
| 4 | L | |||||||||||||
| 5 | XL | |||||||||||||
| 6 | ||||||||||||||
| 7 | ||||||||||||||
| 8 | ||||||||||||||
| 9 | ||||||||||||||
| 10 | ||||||||||||||
| 11 | ||||||||||||||
| 12 | ||||||||||||||
| 13 | ||||||||||||||
| 14 | ||||||||||||||
| 15 | ||||||||||||||
| 16 | ||||||||||||||
| 17 | ||||||||||||||
| 18 | ||||||||||||||
| 19 | ||||||||||||||
| 20 | ||||||||||||||
| 21 | ||||||||||||||
| 22 | ||||||||||||||
| 23 | ||||||||||||||
| 24 | ||||||||||||||
| 25 | ||||||||||||||
| 26 | ||||||||||||||
| 27 | ||||||||||||||
| 28 | ||||||||||||||
| 29 | ||||||||||||||
| 30 |
More to try
Each of these works on the sheet. Press one to put it in B2.
- gives Medium
The second code matches the second pair.
- gives Other
A code that is not listed falls through to the default.
- gives Small
The same idea with IFS, which repeats the cell in every test.
Common mistakes
- Leaving out the default. A value that matches nothing then gives a #N/A error.
- Using it for ranges such as 'over 70'. SWITCH only tests for exact matches; use IFS.
- Getting the pairs out of step. Each value must be followed directly by its own result.
Practise it
Spell out size codes →Related functions