SWITCH
Compare an expression with several candidate values and choose its matching result.
Syntax
=SWITCH(expression, value1, result1, [value2, result2], …, [default])Worked example
Translate a short status code into a readable label.
=SWITCH("P","O","Open","P","Paid","Other")Result Paid
Microsoft documentation
Check the arguments, supported editions and behavior of this function in Microsoft’s reference.
Microsoft referenceExcel SWITCH Function, is it really as good as they say? You might be surprised!
Practice SWITCH
Translate a short status code into a readable label.
| A | B | |
|---|---|---|
| 1 | ||
| 2 | ||
| 3 | ||
| 4 | ||
| 5 | ||
| 6 | ||
| 7 |
Show example formula
=SWITCH(B2,B3,B4,B5,B6,B7) Lesson quiz
Answer three questions to see your level in this lesson.
