Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • Filter Data Based on Date in Excel
  • How to calculate correlation coefficient Correlation in Excel
  • Get column index in Excel Table
  • How to calculate average last N values in a table in Excel
  • How to combine 2 or more chart types in a single chart in Excel

References

  • Two-way lookup with VLOOKUP in Excel
  • How to use Excel VLOOKUP Function
  • How to get last row in numeric data in Excel
  • How to use Excel ROW Function
  • Extract data with helper column in Excel

Data Validations

  • Excel Data validation date in specific year
  • Excel Data validation date in next 30 days
  • Excel Data validation allow uppercase only
  • Excel Data validation allow weekday only
  • How To Create Drop-down List in Excel

SWITCH function example in Excel

by

Excel SWITCH function compares an expression to a list of values and returns the corresponding result.

This example teaches you how to use the SWITCH function in Excel 2016 instead of the IFS function.

1a. For example, the IFS function below finds the correct states.

Explanation: cell A2 contains the string 85-UT. The RIGHT function extracts the 2 rightmost characters from this string (UT). As a result, the IFS function returns the correct state (Utah). If the 2 rightmost characters are not equal to UT, TX or OH, the IFS function returns a question mark. Instead of TRUE, you can also use 1=1 or something else that is always TRUE.

1b. The SWITCH function below produces the exact same result but is much easier to read.

Explanation: if the first argument (RIGHT(A2,2) in this example) equals UT, the SWITCH function returns Utah. If TX, Texas. If OH, Ohio. The last argument (a question mark in this example) is always the default value (if there’s no match).

2. Why not always use the SWITCH function in Excel? There are many examples where you cannot use the SWITCH function instead of the IFS function.

Explanation: because we use”<” and “>=” symbols in this IFS function, we cannot use the SWITCH function.

Post navigation

Previous Post:

COSH function: Description, Usage, Syntax, Examples and Explanation

Next Post:

Excel Data validation require unique number

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others

Logical Functions

  • AND function: Description, Usage, Syntax, Examples and Explanation
  • Not Equal To ‘<>‘ operator in Excel
  • How to use Excel XOR Function
  • SWITCH function: Description, Usage, Syntax, Examples and Explanation
  • IFNA function: Description, Usage, Syntax, Examples and Explanation

Date Time

  • Generate series of dates by weekends in Excel
  • Display the current date in Excel
  • ISOWEEKNUM function: Description, Usage, Syntax, Examples and Explanation
  • Convert text to date in Excel
  • Convert text timestamp into time in Excel

Grouping

  • Group numbers at uneven intervals in Excel
  • Running count group by n size in Excel
  • Group times into unequal buckets in Excel
  • Map inputs to arbitrary values in Excel
  • If cell contains one of many things in Excel

General

  • How to count total columns in range in Excel
  • Lock Cells in a Worksheet Excel
  • Creating and Opening an existing file in Excel
  • How to get random value from list or table in Excel
  • How to create dynamic worksheet reference in Excel
© 2026 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning