Dashboard Mode - SWITCH function
Goal
Find the category of a product based on its code using the SWITCH function.
Find the category of a product based on its code using the SWITCH function.
| Product Code | Product Name | Price |
|---|---|---|
| A1 | Apple | 1.20 |
| B2 | Banana | 0.80 |
| C3 | Carrot | 0.50 |
| D4 | Detergent | 3.00 |
| E5 | Eggs | 2.50 |
| F6 | Flour | 1.00 |
| X9 | Unknown Item | 0.00 |
=SWITCH(A2, "A1", "Fruit", "B2", "Fruit", "C3", "Vegetable", "D4", "Cleaning", "E5", "Dairy", "F6", "Baking", "Unknown")=COUNTIF(E2:E8, "Fruit") (and similar for other categories)+----------------------+---------------------+ | Product List | Category Summary | | (with SWITCH formula) | (counts per category) | +----------------------+---------------------+
Filtering the product list by category updates the summary counts automatically. Selecting a category highlights matching products.
If you add a filter to show only products in the "Fruit" category, which products remain visible and what is the count in the summary?
SWITCH function do in Google Sheets?SWITCH function in Google Sheets?=SWITCH(A1, "Red", 1, "Blue", 2, "Green", 3, 0)Blue?=SWITCH(B2, "Yes", 10, "No", 0)SWITCH: 90+ = "A", 80-89 = "B", 70-79 = "C", below 70 = "F". Which formula correctly uses SWITCH to do this?Pass the test and this pattern moves unknown