Sub topic 1
What a Pivot Table Does and When to Use One
Prerequisites
This chapter assumes you can do the following in Google Sheets:
- Select ranges, use the menus, and enter simple formulas.
- Read data laid out as rows of records and columns of fields.
- Explain what sum, count, and average mean.
You do not need to know pivot tables yet. This chapter builds the working model that the later chapters rely on.
The problem a pivot table solves
Most data starts life as a flat table. Each row is one record, such as one sale, one order, or one support ticket. Each column is one field, such as region, product, date, or amount. A flat table is good for storing data, but it is hard to read once it has hundreds of rows.
A typical question looks like this: "What was the total revenue for each region?" You could answer it with a formula for each region. That works for four regions. It becomes tedious when you add products, months, and sales reps, and each new question needs new formulas.
A pivot table answers this kind of question without formulas. You tell Google Sheets which fields to group by and which field to total, and Sheets builds the summary table for you.
The working model
A pivot table is a summary table built from a source range. It has four parts, and each part controls one thing about the result.
| Part | What it controls | Example |
|---|---|---|
| Rows | Which field gives one line per unique value down the left side | Region |
| Columns | Which field gives one column per unique value across the top | Quarter |
| Values | Which field is calculated, and with which function | Sum of Revenue |
| Filters | Which records are included at all | Status is "Paid" |
Two ideas explain most of what a pivot table does.
- Grouping. Sheets finds every unique value in the Rows field and creates one line for each. It does the same for Columns.
- Aggregation. For each cell in the result, Sheets collects the source records that match that row and column. It then applies a function, such as SUM or COUNTA, to the Values field for those records only.
The result is a grid where each cell answers one question: "For this row value and this column value, what is the sum (or count, or average) of the field?"
The pivot table does not change your source data. It reads the source and shows a view of it. If you delete the pivot table, the source data is unchanged.
A worked example
Suppose a sheet named Sales holds this data, with a header row in row 1:
| Date | Region | Product | Units | Unit price | Revenue |
|---|---|---|---|---|---|
| 2026-01-05 | West | Widget | 10 | 25 | 250 |
| 2026-01-09 | East | Widget | 4 | 25 | 100 |
| 2026-02-14 | West | Gadget | 3 | 80 | 240 |
| 2026-02-20 | East | Gadget | 6 | 80 | 480 |
| 2026-03-02 | West | Widget | 8 | 25 | 200 |
Now consider the question "Revenue by region and product." In pivot terms:
- Rows: Region
- Columns: Product
- Values: Revenue, summarized by SUM
Sheets produces this result:
| Region | Gadget | Widget | Grand Total |
|---|---|---|---|
| East | 480 | 100 | 580 |
| West | 240 | 450 | 690 |
| Grand Total | 720 | 550 | 1270 |
Look at the West and Widget cell. It shows 450 because two source records match both values (250 and 200), and the pivot table added them. You never wrote that formula. If you move Product to Rows and Region to Columns, the table flips, and the numbers stay the same. That ability to rearrange the same data is where the name "pivot" comes from.
What a pivot table gives you that formulas do not
Compare a pivot table with the formula approach on these points.
- Speed of exploration. Moving a field from Rows to Columns takes seconds. With formulas you rewrite each cell.
- Automatic category lists. The pivot table finds the unique regions itself. With SUMIFS you type each region name, and you can miss a new one.
- Built-in totals. Grand totals and subtotals appear without extra formulas.
- Consistent structure. Every cell uses the same aggregation rule, which reduces the risk of one cell having a different formula from its neighbors.
Pivot tables also have limits, which matter when choosing a tool.
- Fixed layout. You cannot type into a pivot table cell or change one value. The table is regenerated from the source, and Sheets does not let you edit its output cells.
- Refresh behavior. The table recalculates when the source data changes, but only for the range it was built on. A source range that does not include newly added rows leads to stale results. Chapter 11 covers this.
- Limited calculations. Ratios, running totals, and conditional logic are harder to build in a pivot table than in a formula.
- Formula references are fragile. A formula that points to a fixed cell inside a pivot table can break when the table grows or reorders. GETPIVOTDATA, covered later, addresses this.
When to use a pivot table
Use a pivot table when:
- You want to summarize many records by one or two categories.
- You are exploring the data and do not yet know which view you need.
- The categories change over time and you do not want to maintain a list of them.
- You want totals, counts, averages, or percentages of a total with little setup.
Consider another tool when:
- You need a single number, such as "total West revenue." A SUMIFS formula is shorter:
=SUMIFS(Sales!F:F, Sales!B:B, "West")- You need a result with custom layout, text, or per-cell logic. A QUERY formula gives you tighter control:
=QUERY(Sales!A1:F, "select B, sum(F) where B is not null group by B label sum(F) 'Total revenue'", 1)- You need to edit the summary cells by hand. A pivot table does not allow this.
You can also use both. A pivot table is quick to build, and a SUMIFS formula gives an independent check on one of its numbers. Chapter 15 covers that cross-check.
Common misunderstandings
Several mistakes come up often for people who have used spreadsheets but are new to pivot tables.
- Thinking the pivot table stores data. It does not. It displays a summary calculated from the source range.
- Expecting to edit results. Cells in a pivot table are read-only. Change the source data or the pivot table settings instead.
- Choosing the wrong function. Revenue should usually be summed. If Sheets counts it instead, the numbers look wrong. This often happens when the field contains text-formatted numbers. Chapter 6 shows how to choose and check the function.
- Mixing granularity. If a source row is already a subtotal, the pivot table will add it to the detail rows and double count. Each source row should represent one record at the same level of detail.
What comes next
The next chapter covers how to prepare a source range so the pivot table builds correctly: a single header row, one type of value per column, and no blank rows or merged cells. After that, you build your first pivot table and learn the editor.
Exercises
Exercise
A sheet has one row per order with the columns Order ID, Customer, Country, and Amount. You want the total Amount for each Country. Which field goes in Rows, which goes in Values, and which summarize function do you use?
Show answer
Put Country in Rows, because you want one line per country. Put Amount in Values, because it is the field being calculated. Use SUM, because you want a total. Customer and Order ID are not needed for this question.
Exercise
A colleague wants to type a manual adjustment of +50 directly into one cell of a pivot table. Why does this not work, and what are two ways to get the adjustment into the result?
Show answer
Pivot table cells are generated from the source range, so they are read-only. One option is to add a record for the adjustment to the source data, so the pivot table includes it. Another option is to leave the pivot table as it is and add the adjustment in a separate formula cell that references the pivot result.
Exercise
You need one number, the total revenue for the West region, and you do not need any other summary. Would you build a pivot table or write a formula? Give the formula if you choose one.
Show answer
A formula is simpler for a single number. For example: =SUMIFS(Sales!F:F, Sales!B:B, "West"). A pivot table is better when you want many groups at once or want to explore the data.