Numbers Exercises

SWITCH in Apple Numbers

Last updated:

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.

Table 1
ABC
1ProductPriceQty
2Apple410
3Pear65
4Kiwi122
5Grape83

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