What you will build
Build a small query summary of paid revenue by region. This lesson uses fictional sample data so you can reproduce each action.
Learning objective
Complete the steps using the dataset below, explain why the feature or formula is used, and recognize issues when inputs change.
Prepare the sample data
Paste this example as tab-separated values beginning at A1 on a new worksheet:
Practice in your own copy
Make your own Google Sheets copy with the same data, formulas, formatting, filter and frozen header. The original remains unchanged.
Sign in to Google. If the original is not publicly shared, download the full workbook and import it into Google Sheets, or paste the example data into your own sheet.
Open the source practice workbook in Google Sheets ↗
Work through the example
Step 1: Confirm row 1 contains field headings.
Step 2: In a blank area H1, query B1:F6 selecting Region (Col1) and Amount (Col4), filtered by Status (Col5).
Step 3: Group by Region and label the sum column so a reader understands the measure.
Formula to try
In the verified practice workbook, use H2 in the Formula result area for the formula below. Keep the source table unchanged and compare the displayed result with the checkpoint.
=QUERY(B1:F6,"select Col1, sum(Col4) where Col5 = 'Paid' group by Col1 label sum(Col4) 'Paid amount'",1)Recalculation check: after the formula returns North = 200 and South = 320, temporarily change the Amount in E2 from 120 to 220. North should recalculate to 300. Restore E2 to 120 and confirm North returns to 200.
Checkpoint
| Region | Paid amount |
|---|---|
| North | 200 |
| South | 320 |
The QUERY result spills from H2:I4. In the recalculation test, changing E2 from 120 to 220 raises North from 200 to 300; restoring E2 to 120 returns North to 200 while South remains 320.
Common mistake and correction
If the result is unexpected, inspect the source cells, destination and referenced range in the formula. QUERY uses its own query-language quoting inside the formula string. Col numbers refer to B:F, not worksheet-wide positions.
Independent practice
After following the example, complete this variation without editing the source data: Query all statuses without the where clause and compare the grouped revenue.
Key takeaways
- ✓Build a small query summary of paid revenue by region.
- ✓Confirm row 1 contains field headings.
- ✓QUERY uses its own query-language quoting inside the formula string. Col numbers refer to B:F, not worksheet-wide positions.
- ✓Query all statuses without the where clause and compare the grouped revenue.
Check your understanding
Answer four questions about the practice sheet.
Continue learning
Previous lesson: UNIQUE function; Next lesson: —.
Comments
No comments yet. Be the first to join the discussion.