How to Find Your Best-Selling Products in Google Sheets
The products that move the most units, with the revenue beside them so you can see when "best-selling" and "most valuable" disagree.
The short answer: =QUERY(Orders!A:K, "select F, sum(H), sum(J) where year(A) = 2026 group by F order by sum(H) desc limit 10 label sum(H) 'Units', sum(J) 'Revenue'", 1). In the sample data, House Blend 5 lb leads with 5,927 units in 2026.
The sample data
| A | B | C | D | E | F | G | H | I | J | K | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Date | Order ID | Customer | Region | Channel | Product | Category | Qty | Unit price | Revenue | Cost |
| 2 | 2025-01-01 | SO-10001 | Tin Roof Café | Northeast | Sales rep | Sip Lids (case of 1,000) | Supplies | 6 | 54 | 324 | 198 |
| 3 | 2025-01-01 | SO-10001 | Tin Roof Café | Northeast | Sales rep | Espresso Roast 5 lb | Coffee | 10 | 68 | 680 | 370 |
| 4 | 2025-01-01 | SO-10002 | Foxglove Café | Northeast | Online store | Sip Lids (case of 1,000) | Supplies | 1 | 54 | 54 | 33 |
| 5 | 2025-01-01 | SO-10002 | Foxglove Café | Northeast | Online store | Cold Brew Concentrate 1 gal | Coffee | 8 | 42 | 336 | 152 |
| 6 | 2025-01-01 | SO-10003 | Ember Café | Midwest | Online store | Sip Lids (case of 1,000) | Supplies | 4 | 54 | 216 | 132 |
| … | 8,115 more rows | ||||||||||
Sample data: a tab named Orders with 8,120 order lines from January 2025 to October 2026, one row per order line. Revenue is Qty × Unit price; Cost is the line's cost of goods (Qty × unit cost). Download orders.csv and import it (File → Import) to follow along. The business is fictional.
The classic way: QUERY on units
Column F is Product, H is Qty and J is Revenue. In A1 of a new tab:
=QUERY(Orders!A:K, "select F, sum(H), sum(J) where year(A) = 2026 group by F order by sum(H) desc limit 10 label sum(H) 'Units', sum(J) 'Revenue'", 1)
sum(H) adds the quantity on every line of each product, order by sum(H) desc ranks by units, and the revenue column comes along for context. To rank by revenue instead, change the order by to sum(J) desc.
| A | B | C | |
|---|---|---|---|
| 1 | Product | Units | Revenue |
| 2 | House Blend 5 lb | 5,927 | $367,474 |
| 3 | Espresso Roast 5 lb | 4,758 | $323,544 |
| 4 | Oat Milk 32 oz (case of 12) | 2,208 | $86,112 |
| 5 | Cold Brew Concentrate 1 gal | 1,582 | $66,444 |
| 6 | 12 oz Hot Cups (case of 1,000) | 1,301 | $124,896 |
| 7 | Chai Concentrate 32 oz (case of 6) | 1,238 | $56,948 |
| 8 | Earl Grey Loose Leaf 1 lb | 1,095 | $30,660 |
| 9 | Sip Lids (case of 1,000) | 952 | $51,408 |
| 10 | Ethiopia Single Origin 5 lb | 892 | $74,928 |
| 11 | Vanilla Syrup 750 ml (6-pack) | 829 | $39,792 |
Computed from the sample CSV above. Cells formatted as currency and percent.
Look at both columns. On the sample data, Ethiopia Single Origin 5 lb ranks ninth by units (892) but fifth by revenue ($74,928) among these ten. Units tell you what to keep in stock; revenue tells you what pays the bills.
Gotchas
- Units are not comparable across pack sizes. One case of 1,000 cups and one 1 lb bag of tea are both "1". Compare units within a category, or rank by revenue.
- Variants split a product. "House Blend 5 lb" and "House Blend 2 lb" rank separately. If you want them together, add a product-family column and group on that.
- Returns. Returned units should come off the total. If returns are separate rows with negative quantity,
sum(H)handles it; if they live elsewhere, it does not.
The one-cell way: =QUIRIZ
With the Quiriz add-on for Google Sheets, you type the question instead of building the formula. =QUIRIZ does not read the cells around it: it answers from the datasets in your Quiriz account. For this example, upload orders.csv as a dataset, or connect your Shopify store. You can also add a Google Sheet itself as a dataset that refreshes on a schedule. Then, in any empty cell:
=QUIRIZ("top 10 products by units sold in 2026, with their revenue", "table")
The "table" mode spills the answer down and to the right from that cell, header row first:
| A | B | C | |
|---|---|---|---|
| 1 | Product | Units | Revenue |
| 2 | House Blend 5 lb | 5,927 | $367,474 |
| 3 | Espresso Roast 5 lb | 4,758 | $323,544 |
| 4 | Oat Milk 32 oz (case of 12) | 2,208 | $86,112 |
| 5 | Cold Brew Concentrate 1 gal | 1,582 | $66,444 |
| 6 | 12 oz Hot Cups (case of 1,000) | 1,301 | $124,896 |
| 7 | Chai Concentrate 32 oz (case of 6) | 1,238 | $56,948 |
| 8 | Earl Grey Loose Leaf 1 lb | 1,095 | $30,660 |
| 9 | Sip Lids (case of 1,000) | 952 | $51,408 |
| 10 | Ethiopia Single Origin 5 lb | 892 | $74,928 |
| 11 | Vanilla Syrup 750 ml (6-pack) | 829 | $39,792 |
Same figures as the formula result above, from the same sample data. The spilled cells are plain numbers, so you can format them, total them or chart them; here they are formatted as currency and percent. Column headings are written with each answer and may be worded differently.
The other modes: "verbose" (the default) answers in a sentence, "bullets" writes two to four points one per cell, and "notes" adds how the figure was calculated. Install Quiriz for Google Sheets and try the question on your own data.
Ask the question, get the table
Quiriz answers business questions in a Google Sheets cell, from your imported files, scheduled Google Sheets and connected tools. Free to start.
Install for Google Sheets →Free on the Google Workspace Marketplace. Or try it on sample data first, no signup.