FormulaCraft

SWITCH

SWITCH evaluates one expression against several values and returns the result for the first match, with an optional default. Cleaner than IFS when you are testing a single cell for equality.

Excel
=SWITCH(A2, "N", "North", "S", "South", "Unknown")
Google Sheets
=SWITCH(A2, "N", "North", "S", "South", "Unknown")

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

How it works

  1. 1A2 is the value being matched.
  2. 2Each pair is a value to match and its result.
  3. 3A final lone argument is the default when nothing matches.

Need a version for your data?

Try: “Turn the code in A2 into a region: N is North, S is South, else Unknown

Related

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: