Bird
Raised Fist0
Excelspreadsheet~20 mins

SWITCH function in Excel - Practice Problems & Coding Challenges

Choose your learning style10 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 numeric match
What is the result of this formula in Excel?

=SWITCH(3, 1, "One", 2, "Two", 3, "Three", "Other")
Excel
=SWITCH(3, 1, "One", 2, "Two", 3, "Three", "Other")
A"Three"
B"Two"
C"Other"
D3
Attempts:
2 left
💡 Hint
Look for the value that matches the first argument exactly.
❓ Function Choice
intermediate
2:00remaining
Choose the correct SWITCH formula for grading
You want to assign letter grades based on numeric scores:
- 90: "A"
- 80: "B"
- 70: "C"
- Otherwise: "F"

Which formula correctly uses SWITCH to do this for a score in cell A1?
A=SWITCH(TRUE, A1>=90, "A", A1>=80, "B", A1>=70, "C", "F")
B=SWITCH(A1, "A", 90, "B", 80, "C", 70, "F")
C=SWITCH(A1, 90, "A", 80, "B", 70, "C", "F")
D=SWITCH(A1>=90, "A", A1>=80, "B", A1>=70, "C", "F")
Attempts:
2 left
💡 Hint
SWITCH compares the first argument to each value exactly.
🎯 Scenario
advanced
2:30remaining
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", "Saturday", "Weekday", "Sunday", "Weekday", "Weekend")
B=SWITCH(B2, "Saturday", "Weekend", "Sunday", "Weekend", "Monday", "Weekday", "Tuesday", "Weekday", "Wednesday", "Weekday", "Thursday", "Weekday", "Friday", "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")
Attempts:
2 left
💡 Hint
Include all days and a default value for unknown days.
📊 Formula Result
advanced
1:30remaining
Result of SWITCH with missing match and no default
What is the result of this formula?

=SWITCH("Blue", "Red", 1, "Green", 2, "Yellow", 3)
Excel
=SWITCH("Blue", "Red", 1, "Green", 2, "Yellow", 3)
A3
B#N/A
C0
D"Blue"
Attempts:
2 left
💡 Hint
What happens if no match is found and no default is given?
❓ data_analysis
expert
3:00remaining
Count how many cells return "Pass" using SWITCH
You have a list of scores in cells A1:A6:
85, 92, 70, 60, 88, 75

You use this formula in B1 and copy down to B6:
=SWITCH(TRUE, A1>=90, "Pass", A1>=70, "Pass", "Fail")

How many cells in B1:B6 will show "Pass"?
Excel
=SWITCH(TRUE, A1>=90, "Pass", A1>=70, "Pass", "Fail")
A4
B3
C6
D5
Attempts:
2 left
💡 Hint
Check each score against the conditions in order.

Practice

(1/5)
1. What does the SWITCH function do in Excel?
easy
A. It sorts data alphabetically.
B. It adds numbers in a range.
C. It selects a value from multiple options based on a single expression.
D. It counts the number of cells with text.

Solution

  1. Step 1: Understand the purpose of SWITCH

    The SWITCH function evaluates one expression and compares it to a list of values.
  2. Step 2: Identify what SWITCH returns

    It returns the result corresponding to the first matching value or a default if no match is found.
  3. Final Answer:

    It selects a value from multiple options based on a single expression. -> Option C
  4. Quick Check:

    SWITCH chooses from options based on one value [OK]
Hint: SWITCH picks one result from many choices based on one value [OK]
Common Mistakes:
  • Confusing SWITCH with SUM or COUNT functions
  • Thinking SWITCH sorts data
  • Believing SWITCH counts text cells
2. Which of these is the correct syntax for the SWITCH function in Excel?
easy
A. SWITCH(expression, value1, result1, [value2, result2], ..., [default])
B. SWITCH(expression; value1; result1; [value2; result2]; ...; [default])
C. SWITCH(expression, [value1, result1], [value2, result2], ..., default)
D. SWITCH(expression: value1: result1: value2: result2: default)

Solution

  1. Step 1: Recall Excel function syntax

    Excel functions use commas to separate arguments, not semicolons or colons.
  2. Step 2: Match the correct SWITCH syntax

    The correct syntax is SWITCH(expression, value1, result1, [value2, result2], ..., [default]).
  3. Final Answer:

    SWITCH(expression, value1, result1, [value2, result2], ..., [default]) -> Option A
  4. Quick Check:

    Commas separate SWITCH arguments in Excel [OK]
Hint: Remember: Excel uses commas, not semicolons or colons [OK]
Common Mistakes:
  • Using semicolons or colons instead of commas
  • Placing default value without commas
  • Using brackets incorrectly around arguments
3. What is the result of this formula?
=SWITCH(3, 1, "One", 2, "Two", 3, "Three", "Other")
medium
A. "One"
B. "Two"
C. "Other"
D. "Three"

Solution

  1. Step 1: Identify the expression value

    The expression is 3, so SWITCH looks for value 3 in the list.
  2. Step 2: Find matching value and return result

    Value 3 matches the third pair, so it returns "Three".
  3. Final Answer:

    "Three" -> Option D
  4. Quick Check:

    Expression 3 matches value 3, returns "Three" [OK]
Hint: Match expression to value pairs in order to find result [OK]
Common Mistakes:
  • Choosing default result instead of matching value
  • Confusing value and result pairs order
  • Ignoring the expression value
4. Identify the error in this formula:
=SWITCH(A1, 1, "One", 2, "Two", 3, "Three")
Assume A1 contains 4.
medium
A. Missing default value causes #N/A error when no match found.
B. Syntax error due to missing commas.
C. Incorrect use of quotes around numbers.
D. SWITCH cannot handle numeric values.

Solution

  1. Step 1: Check for default value in SWITCH

    The formula lacks a default result for unmatched values.
  2. Step 2: Understand behavior when no match found

    Since A1 is 4 and no match exists, SWITCH returns #N/A error without default.
  3. Final Answer:

    Missing default value causes #N/A error when no match found. -> Option A
  4. Quick Check:

    Always add default to avoid errors [OK]
Hint: Always add a default result to SWITCH to prevent errors [OK]
Common Mistakes:
  • Forgetting default value causes #N/A error
  • Thinking SWITCH needs quotes around numbers
  • Assuming SWITCH can't handle numbers
5. You want to assign letter grades based on scores in cell B2: 90+ = "A", 80-89 = "B", 70-79 = "C", 60-69 = "D", below 60 = "F".
Which SWITCH formula correctly assigns these grades?
hard
A. =SWITCH(B2, 90, "A", 80, "B", 70, "C", 60, "D", "F")
B. =SWITCH(TRUE, B2>=90, "A", B2>=80, "B", B2>=70, "C", B2>=60, "D", "F")
C. =SWITCH(B2>=90, "A", B2>=80, "B", B2>=70, "C", B2>=60, "D", "F")
D. =SWITCH(B2, TRUE, "A", FALSE, "F")

Solution

  1. Step 1: Use SWITCH with logical TRUE to evaluate conditions

    Using SWITCH(TRUE, ...) lets us test multiple conditions in order.
  2. Step 2: Check conditions from highest to lowest

    Conditions check if B2 is >=90, >=80, etc., returning correct grade or default "F".
  3. Final Answer:

    =SWITCH(TRUE, B2>=90, "A", B2>=80, "B", B2>=70, "C", B2>=60, "D", "F") -> Option B
  4. Quick Check:

    SWITCH(TRUE, conditions...) assigns grades by ranges [OK]
Hint: Use SWITCH(TRUE, condition1, result1, ...) for range checks [OK]
Common Mistakes:
  • Using SWITCH with exact values instead of conditions
  • Not ordering conditions from highest to lowest
  • Missing default grade for scores below 60
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard