Dashboard Mode - SWITCH function
Dashboard Goal
Help a small store quickly categorize products by type using the SWITCH function to assign product categories based on product codes.
Help a small store quickly categorize products by type using the SWITCH function to assign product categories based on product codes.
| Product Code | Product Name | Price |
|---|---|---|
| A1 | Apple | 1.20 |
| B2 | Bread | 2.50 |
| C3 | Carrot | 0.80 |
| D4 | Detergent | 5.00 |
| A2 | Avocado | 1.50 |
| B3 | Butter | 3.00 |
| X9 | Unknown Item | 4.00 |
=SWITCH(A2, "A1", "Fruit", "A2", "Fruit", "B2", "Bakery", "B3", "Bakery", "C3", "Vegetable", "D4", "Cleaning", "Other")=SUMIF(D2:D8, "Fruit", C2:C8)+----------------------+---------------------+ | Product List | Category Totals | | +------------------+ | +-----------------+ | | | Product Code | | | Fruit: 2.70 | | | | Product Name | | | Bakery: 5.50 | | | | Price | | | Vegetable: 0.80 | | | | Category (SWITCH)| | | Cleaning: 5.00 | | | +------------------+ | | Other: 4.00 | | +----------------------+ +-----------------+ +
Add a filter dropdown for Category. When a category is selected, the product list and total sales update to show only that category's products and totals.
This uses the Category column created by SWITCH as the filter basis.
If you add a filter to show only Bakery category, which components update?