SWITCH Formula Generator

SWITCH picks a result from a list of pairs — cleaner and more readable than nested IFs when matching against specific values.

Syntax=SWITCH(expression, value1, result1, [value2, result2, ...], [default])
Try it — generate a SWITCH formula

Examples

Map status codes to labels

=SWITCH(A2, 1, "New", 2, "In Progress", 3, "Done", "Unknown")

Looks up A2 against the pairs. No match → "Unknown" default.

Day-of-week to type

=SWITCH(WEEKDAY(A2,2), 6, "Weekend", 7, "Weekend", "Weekday")

Multiple matches can share a result only by repeating pairs; use OR+IF if that gets ugly.

Grade letter from number

=SWITCH(TRUE, A2>=90, "A", A2>=80, "B", A2>=70, "C", "F")

Trick: SWITCH(TRUE, ...) turns it into a cleaner IF chain.

Tips

Related Formulas

Nested IF

Nested IF formulas let you test multiple conditions and return different values ...

VLOOKUP

VLOOKUP searches for a value in the first column of a table and returns a value ...

XLOOKUP

XLOOKUP is the modern replacement for VLOOKUP and HLOOKUP. It can search in any ...

Need a different formula?

Describe any formula in plain English and FormulaPad will generate it.

Try FormulaPad Free