🔀 Logic
SWITCH Formula for Logic
Match value against list of cases. Copy-paste ready for Excel, Google Sheets, and Airtable.
=SWITCH(A1,"A","Excellent","B","Good","C","Fair","Unknown")When you need this: When you have student grades (A, B, C in A1) and need to convert to descriptions ("Excellent", "Good", "Fair").
How it works
- 1SWITCH compares an expression (A1) against multiple values.
- 2When a value matches, return its corresponding result.
- 3Include a default result at the end ("Unknown").
Variations
SWITCH for status codes
=SWITCH(A1,0,"Inactive",1,"Active",2,"Pending","Unknown")Nested SWITCH example
=SWITCH(MONTH(A1),1,"Q1",2,"Q1",3,"Q1",4,"Q2","Later")Related Formulas
IF — Return different values based on a conditionLogicIFS — Check multiple conditions (cleaner than nested IF)LogicIFERROR — Show a custom value instead of an errorLogicAND / OR — Check if multiple conditions are trueLogic
Need a formula that's not here?
Generate custom formula →