What SWITCH does
SWITCH compares one expression against a list of values and returns the result for the first match. It is a cleaner alternative to nested IF when you are matching against specific values rather than ranges.
When combined with TRUE as the expression, SWITCH can also evaluate conditions, making it behave like IFS.
Practical examples
Map a department code to a name
=SWITCH(A2,"HR","Human Resources","ENG","Engineering","MKT","Marketing","Unknown")
Each code is matched exactly. The last argument without a pair is the default.
Use SWITCH with TRUE for range-based logic
=SWITCH(TRUE,A2<10,"XS",A2<20,"S",A2<30,"M",A2<40,"L","XL")
This pattern evaluates conditions in order, similar to IFS.
Common mistakes and notes
SWITCH matches exact values
Unlike IFS, SWITCH compares the expression against specific values. For greater-than or less-than logic, use the SWITCH(TRUE, ...) pattern or use IFS instead.
Maximum of 126 pairs
SWITCH supports up to 126 value/result pairs. In practice, if you need that many branches, a lookup table with VLOOKUP or XLOOKUP is usually better.
Availability
SWITCH is available in Excel 365, Excel 2021, and Excel 2019. It is not available in Excel 2016 or earlier.