Functions
SWITCH
Match expression against values
Try it
When to use it
When should I use SWITCH instead of IFS?
Use SWITCH when you are comparing one expression against several exact values; use IFS when each branch needs a different logical test.
Can SWITCH have a default value?
Yes — a final argument with no matching value acts as the default that SWITCH returns when nothing else matches.
Use cases
Convert a day number to a name
Look up a code and return its value
Used in
Syntax
SWITCH(expr, val1, result1,...)