SWITCH() Function in Excel and 3 Alternatives

Add to Favorites
Author: | Edits: don

How to use the SWITCH() function for Excel.

SWITCH() allows you to match a series of values and output a value based on that match - this replaces basic nested IF statements in Excel.

This tutorial covers the syntax of the switch function and shows you how to use it. As well, 3 robust alternatives to the switch function are also covered and explained.

The benefit to showing you this function and its alternatives is to allow you to have the tools that you need to use the best formula for the job. Sometimes you may want a complex setup that is more robust and versatile and utilizes a VLOOKUP() and a lookup table and sometimes you want an old-school IF statement and sometimes, the new SWITCH() function is the perfect tool for the job.

Syntax

=SWITCH(Value to switch, Value to match1...[2-126], Value to return if there's a match1...[2-126], Value to return if there's no match)

Example

=SWITCH(A4,1,"Good",2,"Ok",3,"Bad","Not Allowed")

A4 is the cell with the value to check.

1 is the first value to check for.

Good is the value to output if cell A4 contains 1

This pattern is followed until the last argument, which is what is output if there is no match found.

Not Allowed is the default value that is output if no match is found.

Resources

15 IF Statement Examples in Excel

5 Bite-Size Vlookup Tricks for Excel

 


Excel Function: CHOOSE(), IF(), SWITCH(), VLOOKUP()
Excel Version: Excel 2016, Excel 2019, Excel 365
Downloadable Files: Excel File

Question? Ask it in our Excel Forum


Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons 50+ Hours of Instruction 200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Similar Content on TeachExcel
Quickly See All Cells linked to a Formula or Function in Excel
Tutorial: Ill show you how to see the cells used in a formula/function in Excel and also how to tel...
Understanding Formulas and Functions in Excel
Tutorial: In this tutorial I will cover the basic concepts of Formulas and Functions in Excel. A for...
How to use the CONVERT Function in Excel
Tutorial: Use the CONVERT function in Excel to switch between measurements, including distance, tem...
VLOOKUP() Function in Excel
Tutorial: Full explanation of the Vlookup function in Excel, what it is, how to use it, and when yo...
Easily Input Complex Functions in Excel
Tutorial: In this tutorial I am going to show you how to easily input complex Functions in Excel. To...
OFFSET Function in Excel
Tutorial: The OFFSET function in Excel returns a cell or range reference that is a specified number...
Tutorial Details
Excel Function: CHOOSE(), IF(), SWITCH(), VLOOKUP()
Excel Version: Excel 2016, Excel 2019, Excel 365
Downloadable Files: Excel File
Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course