SWITCH in Apple Numbers
Short answer: SWITCH compares a value with a list of possibilities and returns the matching result. Syntax:
SWITCH(value, match, result, …, default)Explanation
SWITCH compares a value with a list of possibilities and returns the matching result. The last argument without a partner is the default. Cleaner than many nested IF functions.
Syntax
SWITCH(value, match, result, …, default)Example
Return the number for the product in A3: Apple is 1, Pear is 2, anything else 0.
| A | B | C | |
|---|---|---|---|
| 1 | Product | Price | Qty |
| 2 | Apple | 4 | 10 |
| 3 | Pear | 6 | 5 |
| 4 | Kiwi | 12 | 2 |
| 5 | Grape | 8 | 3 |
Formula: =SWITCH(A3,"Apple",1,"Pear",2,0)
Result: 2
Frequently asked questions
What does SWITCH do in Apple Numbers?
SWITCH compares a value with a list of possibilities and returns the matching result. The last argument without a partner is the default. Cleaner than many nested IF functions.
What is the syntax of SWITCH?
The syntax is SWITCH(value, match, result, …, default).
More in this category
Practise it yourself
Type the formula yourself in a real exercise and see right away if your answer is correct. The first exercises are free.
Start practising