Returns a different value depending on whether a match was found or not
SWITCH(value, value_to_match, value_to_return_if_match, value_to_return_if_no_match)
SWITCH tests value against value_to_match.
It returns value_to_return_if_match if value was found in value_to_match otherwise returns value_to_return_if_no_match.
Example:
If A1 contains 1:
SWITCH(A1, 1, "Matches", "Does not match")
returns Matches
If A1 contains 2:
SWITCH(A1, 1, "Matches", "Does not match")
returns Does not match
A | B | ||
|---|---|---|---|
1 | 1 | Matches |
Customer Feedback Categorization
Imagine you run an online store, and you collect customer feedback where customers rate their experience on a scale of 1 to 5. You want to categorize these numerical ratings into descriptive labels for easier analysis (e.g., "Very Poor," "Poor," "Average," "Good," "Excellent").
Table:
Customer ID | Rating | Feedback Category | ||
|---|---|---|---|---|
A | B | C | ||
1 | 101 | 4 | Good | |
2 | 102 | 2 | Poor | |
3 | 103 | 5 | Excellent | |
4 | 104 | 1 | Very Poor | |
5 | 105 | 3 | Average | |
6 | 106 | 5 | Excellent | |
7 | 107 | 4 | Good |
The SWITCH Formula:
To get the "Feedback Category" in column C, you would enter the following formula into cell C1:
SWITCH(B1,
1, "Very Poor",
2, "Poor",
3, "Average",
4, "Good",
5, "Excellent",
"Invalid Rating"
)
Explanation of the Formula:
PRODUCT & FEATURES
RESOURCES
Terms | Privacy | Spam Policy
© 2026 Zapof