Dashboard Mode - ORDER BY clause
Goal
Sort a list of products by their sales amount to quickly see which products sold the most and which sold the least.
Sort a list of products by their sales amount to quickly see which products sold the most and which sold the least.
| Product | Category | Sales |
|---|---|---|
| Apples | Fruit | 150 |
| Bananas | Fruit | 120 |
| Carrots | Vegetable | 90 |
| Broccoli | Vegetable | 110 |
| Oranges | Fruit | 200 |
| Potatoes | Vegetable | 130 |
=SORT(A2:C7, 3, FALSE)=INDEX(SORT(A2:C7, 3, FALSE), 1, 1)=INDEX(SORT(A2:C7, 3, FALSE), 1, 3)+----------------------+-----------------------+ | Top Product Card | Top Sales Amount Card | +----------------------+-----------------------+ | | | Sorted Sales Table | | | +----------------------------------------------+
Add a filter dropdown to select a category (Fruit or Vegetable). When a category is selected, the sorted table and top product cards update to show only products from that category.
Example filter formula: =FILTER(A2:C7, B2:B7=E1) where E1 is the selected category.
Then apply SORT on the filtered data to keep sorting by sales.
If you add a filter to show only 'Fruit' category, which products appear in the sorted table?
Answer: Oranges, Apples, Bananas (sorted by sales descending: 200, 150, 120)
ORDER BY clause do inside a Google Sheets QUERY function?ORDER BY clause is used to sort data in a query result.ASC, descending by DESC.ORDER BY B ASC which is correct syntax for ascending order. Options B and C use invalid keywords DOWN and UP. =QUERY(A1:C10, "SELECT * ORDER BY B DESC") sorts descending, not ascending.A Score John 85 Anna 92 Mike 78 Sara 90
=QUERY(A1:B4, "SELECT A, B ORDER BY B DESC")?=QUERY(A1:C10, "SELECT A, B ORDER BY C DESCENDING") but it gives an error. What is the problem?DESC, not DESCENDING.Name, Age, and Score. You want to list all names and scores sorted by Age ascending, then Score descending. Which QUERY formula is correct?Pass the test and this pattern moves unknown