Description
NOTE
  • The [expression] can be a value, array, reference..
Syntax
Copied!
=SWITCH(expression, [case_1, value_1], [case_2, value_2], ..., [default])
SAMPLE data
|     | A   | B   | C   | D   | E   |
|:---:|:----|:----|:----|:----|:----|
|  1  |     |     | A   |     |     |
|-----|-----|-----|-----|-----|-----|
|  2  |     |     | B   |     |     |
|-----|-----|-----|-----|-----|-----|
|  3  |     |     | 4   |     |     |
|-----|-----|-----|-----|-----|-----|
|  4  |     |     | D   |     |     |
|-----|-----|-----|-----|-----|-----|
|  5  |     |     | 8   |     |     |
|-----|-----|-----|-----|-----|-----|
|  6  |     |     |     |     |     |
|-----|-----|-----|-----|-----|-----|
|  7  |     |     | 2   |     |     |
|-----|-----|-----|-----|-----|-----|
|  8  |     |     | E   |     |     |
|-----|-----|-----|-----|-----|-----|
|  9  |     |     |     |     |     |
EXAMPLE 1
Copied!
=SWITCH(TYPE(C1), 1, "NUMBER", 2, "TEXT", "-")
|     | A      |
|:---:|:-------|
|  1  | TEXT   |
|-----|--------|
|  2  | TEXT   |
|-----|--------|
|  3  | NUMBER |
|-----|--------|
|  4  | TEXT   |
|-----|--------|
|  5  | NUMBER |
|-----|--------|
|  6  | NUMBER |
|-----|--------|
|  7  | NUMBER |
|-----|--------|
|  8  | TEXT   |
|-----|--------|
|  9  | NUMBER |

Join our newsletter to stay up to date

Click the button below to sign up for our advanced platform. Get started now and see the benefits for yourself.

EN | VI