Pinterest Pixel

SWITCH Formula in Excel

  Want to know How To Master the SWITCH Function in Excel? *** Watch our video and... read more

Download Excel Workbook
Bryan
Posted on

Overview

SWITCH Formula in Excel | MyExcelOnline

 

Want to know How To Master the SWITCH Function in Excel?

*** Watch our video and step by step guide below with free downloadable Excel workbook to practice ***

Watch on YouTube and give it a thumbs up 👍

SWITCH Formula in Excel | MyExcelOnline

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 workbookSWITCH-FORMULA.xlsx

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

 

SWITCH Formula in Excel | MyExcelOnline

 

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

SWITCH Formula in Excel | MyExcelOnline
SWITCH Formula in Excel | MyExcelOnline
Bryan

Bryan is a best-selling book author of the 101 Excel Series paperback books.

Get Video Training

Advance your Microsoft Excel & Office Skills with the MyExcelOnline Academy!

Dramatically Reduce Repetition, Stress, and Overtime!
Exponentially Increase Your Chances of a Promotion, Pay Raise or New Job!

Learn in as little as 5 minutes a day or on your schedule.

Learn More!