What does it do?

Matches multiple values and returns the first value that has a match

Formula breakdown:

=SWITCH(expression, value1, result1, [value2 / default, result2], …)

What it means:

=SWITCH(value to check, value to match against, result to return, [succeeding values to match or the default value if nothing gets matched], …)


If you have multiple values to check, we can use Excel’s SWITCH Formula! It allows us to specify multiple values to check, then the SWITCH Formula will look for the first value that gets matched!

Let us try it out on a simple ratings table (e.g. 1 = Bad, 2 = Average, 3 = Great), then we will create a SWITCH Formula that will simulate the exact same logic of the table!

I explain how you can do this below:

DOWNLOAD EXCEL WORKBOOK

STEP 1: We need to enter the SWITCH function in a blank cell:

=SWITCH(

SWITCH Formula in Excel

 

STEP 2: The SWITCH arguments:

expression

What is the value to check?

Select the cell containing the rating that you want to translate to the correct description

=SWITCH(G8, 

SWITCH Formula in Excel

value1, result1

What is the first lookup value and value to return if it is matched?

Let us start from the first value of the rating table. If the value is 1, then the description is “Bad”

=SWITCH(G8, 1, “Bad”

SWITCH Formula in Excel

value2, result2

What is the second lookup value and value to return if it is matched?

Let us start from the second value of the rating table. If the value is 2, then the description is “Average”

=SWITCH(G8, 1, “Bad”, 2, “Average”,

SWITCH Formula in Excel

value3, result3

What is the third lookup value and value to return if it is matched?

Let us start from the third value of the rating table. If the value is 3, then the description is “Great”

=SWITCH(G8, 1, “Bad”, 2, “Average”, 3, “Great”,

SWITCH Formula in Excel

 

default

What is the default value to return if nothing gets matched?

We want to show the value “Unknown”, if an unknown rating is specified.

=SWITCH(G8, 1, “Bad”, 2, “Average”, 3, “Great”, “Unknown”)

SWITCH Formula in Excel

You now have your correct rating description!

SWITCH Formula in Excel

Let us try an unknown rating (40) and see the resulting description:

SWITCH Formula in Excel

 

How to Use the SWITCH Formula in Excel

HELPFUL RESOURCE:

 

 

If you like this Excel tip, please share itEmail this to someone

email

Pin on Pinterest

Pinterest

Share on Facebook

Facebook

Tweet about this on Twitter

Twitter

Share on LinkedIn

Linkedin

Related Excel Tutorials