0
0
Google Sheetsspreadsheet~20 mins

SWITCH function in Google Sheets - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
SWITCH Function Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📊 Formula Result
intermediate
1:30remaining
Output of SWITCH with matching case
What is the output of this formula in Google Sheets?

=SWITCH(3, 1, "One", 2, "Two", 3, "Three", "Other")
Google Sheets
=SWITCH(3, 1, "One", 2, "Two", 3, "Three", "Other")
A"Three"
B"Other"
C"Two"
D3
Attempts:
2 left
💡 Hint
Look for the value that matches the first argument exactly.
📊 Formula Result
intermediate
1:30remaining
Output when no match and default provided
What does this formula return?

=SWITCH("apple", "banana", "Yellow", "orange", "Orange", "Unknown")
Google Sheets
=SWITCH("apple", "banana", "Yellow", "orange", "Orange", "Unknown")
Aapple
B"Orange"
C"Yellow"
D"Unknown"
Attempts:
2 left
💡 Hint
Check if the first argument matches any case. If not, the default is returned.
Function Choice
advanced
2:00remaining
Choosing the right function for multiple conditions
You want to assign a grade based on a score:
- 90 or above: "A"
- 80 to 89: "B"
- 70 to 79: "C"
- Below 70: "F"

Which formula using SWITCH will correctly assign the grade for a score in cell A1?
A=SWITCH(A1, 90, "A", 80, "B", 70, "C", "F")
B=SWITCH(TRUE, A1>=90, "A", A1>=80, "B", A1>=70, "C", "F")
C=SWITCH(A1>=90, "A", A1>=80, "B", A1>=70, "C", "F")
D=SWITCH(A1, TRUE, "A", FALSE, "F")
Attempts:
2 left
💡 Hint
Use SWITCH with TRUE as the first argument to evaluate conditions.
🎯 Scenario
advanced
2:00remaining
Using SWITCH to categorize weekdays
You have a cell B2 containing a weekday name (e.g., "Monday", "Tuesday", etc.).

Which formula using SWITCH will return "Weekday" for Monday to Friday and "Weekend" for Saturday and Sunday?
A=SWITCH(B2, "Monday", "Weekday", "Tuesday", "Weekday", "Wednesday", "Weekday", "Thursday", "Weekday", "Friday", "Weekday")
B=SWITCH(B2, "Saturday", "Weekend", "Sunday", "Weekend", "Weekday")
C=SWITCH(B2, "Monday", "Weekday", "Tuesday", "Weekday", "Wednesday", "Weekday", "Thursday", "Weekday", "Friday", "Weekday", "Saturday", "Weekend", "Sunday", "Weekend", "Unknown")
D=SWITCH(B2, "Monday", "Weekday", "Tuesday", "Weekday", "Wednesday", "Weekday", "Thursday", "Weekday", "Friday", "Weekday", "Saturday", "Weekday", "Sunday", "Weekday")
Attempts:
2 left
💡 Hint
Make sure all days are covered with correct labels and a default value.
data_analysis
expert
2:30remaining
Count how many times SWITCH returns a specific value
You have a list of fruit names in column A (A2:A10). You use this formula in column B to categorize fruits:

=SWITCH(A2, "apple", "Red", "banana", "Yellow", "grape", "Purple", "Other")

Which formula will correctly count how many fruits are categorized as "Yellow" in column B?
A=COUNTIF(B2:B10, "Yellow")
B=COUNTIF(B2:B10, "banana")
C=COUNTIF(A2:A10, "Yellow")
D=COUNTIF(A2:A10, "banana")
Attempts:
2 left
💡 Hint
Count the occurrences of the category in the column where SWITCH results are stored.