What does the SWITCH function do in Google Sheets?
The SWITCH function checks a value against a list of cases and returns the result for the first matching case. If no match is found, it can return a default value.
Click to reveal answer
beginner
How do you write a basic SWITCH formula?
Use =SWITCH(expression, case1, result1, case2, result2, ..., default) where expression is what you check, cases are possible matches, and results are what you get if matched.
Click to reveal answer
intermediate
What happens if no cases match and no default is provided in SWITCH?
If no match is found and no default value is given, SWITCH returns an error (#N/A).
Click to reveal answer
intermediate
Can SWITCH replace nested IF statements?
Yes, SWITCH can simplify formulas by replacing multiple nested IFs when checking one value against many options.
Click to reveal answer
beginner
Example: What does =SWITCH(A1, "Red", 1, "Blue", 2, "Green", 3, 0) return if A1 is "Blue"?
It returns 2 because "Blue" matches the second case, so the result is 2.
Click to reveal answer
What is the correct order of arguments in the SWITCH function?
The first argument is the expression to check, followed by pairs of cases and results, and optionally a default value.
If no case matches and no default is given, what does SWITCH return?
A#N/A error
BEmpty string
C0
DThe first case's result
✗ Incorrect
Without a default, SWITCH returns a #N/A error if no case matches.
Which function can SWITCH help simplify?
ACOUNT
BVLOOKUP
CSUM
DNested IF
✗ Incorrect
SWITCH can replace multiple nested IF statements checking one value.
What will =SWITCH(3, 1, "One", 2, "Two", 3, "Three", "Other") return?
A"Three"
B"Two"
C"Other"
D"One"
✗ Incorrect
3 matches the third case, so the result is "Three".
Can SWITCH handle text and numbers as cases?
ANo, only numbers.
BYes, it can handle both text and numbers.
CNo, only text.
DOnly dates.
✗ Incorrect
SWITCH can compare the expression to text, numbers, or other types.
Explain how the SWITCH function works and give a simple example.
Think about choosing from options based on one value.
You got /5 concepts.
Describe a situation where SWITCH is better than nested IF statements.
Imagine you want to assign grades based on a letter.
You got /4 concepts.
Practice
(1/5)
1. What does the SWITCH function do in Google Sheets?
easy
A. It selects a value based on matching a given expression to cases.
B. It adds up all numbers in a range.
C. It finds the average of numbers in a list.
D. It sorts data alphabetically.
Solution
Step 1: Understand the purpose of SWITCH
The SWITCH function compares a value to multiple cases and returns the matching result.
Step 2: Compare with other options
Options A, B, and D describe different functions (AVERAGE, SUM, SORT), not SWITCH.
Final Answer:
It selects a value based on matching a given expression to cases. -> Option A
Quick Check:
SWITCH matches value to cases = It selects a value based on matching a given expression to cases. [OK]
Hint: Remember SWITCH picks result by matching value [OK]
Common Mistakes:
Confusing SWITCH with SUM or AVERAGE
Thinking SWITCH sorts data
Missing that SWITCH needs a matching value
2. Which of these is the correct syntax for the SWITCH function in Google Sheets?
easy
A. SWITCH(expression; case1; result1; case2; result2; default)
B. SWITCH(expression, case1, result1, case2, result2, ..., default)
C. SWITCH(expression, case1:result1, case2:result2, default)
D. SWITCH(expression, {case1, result1}, {case2, result2}, default)
Solution
Step 1: Recall SWITCH syntax
The correct syntax uses commas to separate expression, cases, results, and default value.
Step 2: Check each option
SWITCH(expression, case1, result1, case2, result2, ..., default) uses commas correctly. SWITCH(expression; case1; result1; case2; result2; default) uses semicolons (wrong in Google Sheets). Options C and D use incorrect separators or braces.
Final Answer:
SWITCH(expression, case1, result1, case2, result2, ..., default) -> Option B
Hint: Use commas, not semicolons, to separate SWITCH arguments [OK]
Common Mistakes:
Using semicolons instead of commas
Using colons or braces incorrectly
Omitting the default value
3. What is the result of this formula in Google Sheets? =SWITCH(A1, "Red", 1, "Blue", 2, "Green", 3, 0) If cell A1 contains the text Blue?
medium
A. 2
B. 1
C. 3
D. 0
Solution
Step 1: Identify the value in A1
A1 contains "Blue".
Step 2: Match A1 value with SWITCH cases
"Blue" matches the second case, which returns 2.
Final Answer:
2 -> Option A
Quick Check:
Value "Blue" returns 2 [OK]
Hint: Match the cell value to cases to find result fast [OK]
Common Mistakes:
Choosing the default value instead of matching case
Confusing case order
Ignoring exact text match
4. This formula returns an error. What is wrong? =SWITCH(B2, "Yes", 10, "No", 0)
medium
A. Too many arguments provided
B. Wrong use of quotation marks
C. Missing default value argument at the end
D. Incorrect cell reference syntax
Solution
Step 1: Check SWITCH argument count
The formula has expression, two cases with results, but no default value.
Step 2: Understand default value necessity
SWITCH requires a default value to return if no case matches; missing it causes an error.
Final Answer:
Missing default value argument at the end -> Option C
Quick Check:
Always include default value in SWITCH [OK]
Hint: Always add a default value to avoid errors [OK]
Common Mistakes:
Forgetting the default value
Thinking quotes cause error
Assuming cell reference is wrong
5. You want to assign grades based on scores in cell C3 using SWITCH: 90+ = "A", 80-89 = "B", 70-79 = "C", below 70 = "F". Which formula correctly uses SWITCH to do this?
hard
A. =SWITCH(C3, TRUE, "A", FALSE, "F")
B. =SWITCH(C3, 90, "A", 80, "B", 70, "C", "F")
C. =SWITCH(C3>=90, "A", C3>=80, "B", C3>=70, "C", "F")
D. =SWITCH(TRUE, C3>=90, "A", C3>=80, "B", C3>=70, "C", TRUE, "F")
Solution
Step 1: Understand SWITCH with logical TRUE
Using SWITCH(TRUE, ...) lets us test conditions in order, returning the first TRUE match.
Step 2: Check each condition and result pair
=SWITCH(TRUE, C3>=90, "A", C3>=80, "B", C3>=70, "C", TRUE, "F") correctly tests if C3>=90, then C3>=80, then C3>=70, else default TRUE returns "F".