Sub topic 3
Creating your first pivot table
This chapter assumes you can select ranges, use the Sheets menus, and read a table of records with one row per record and one column per field. It also assumes you know what sum, count, and average mean. It builds on the previous chapter, where you cleaned the source data. Here you turn that data into a working pivot table and learn what Sheets does behind the scenes when it creates one.
What you will build
A pivot table summarizes a table of records without formulas. You choose which fields group the data and which field gets calculated. Sheets does the grouping and arithmetic.
The examples use a sheet named Sales with a header row in row 1 and these columns:
| Column | Header | Example value |
|---|---|---|
| A | Order Date | 2026-01-14 |
| B | Region | West |
| C | Product | Notebook |
| D | Units | 12 |
| E | Revenue | 144.00 |
By the end of the chapter you will have a table that shows total revenue for each region.
Step 1: Select the source range
Click any single cell inside the data, such as B3. Then open Insert > Pivot table. When you start from one cell, Sheets looks for the surrounding block of data and selects it for you.
You can also select the range yourself. If the data may grow, select whole columns, for example Sales!A:E. Whole columns keep new rows in the source. You will look at the growth trade-offs in a later chapter. For now, remember two rules:
- The first row of the range must hold the headers. Sheets uses those headers as field names.
- Every column needs a header. A blank header cell makes the field hard to use, and you cannot reliably select it later.
Step 2: Choose where the table goes
The Create pivot table dialog asks for two things. The first is the data range, which you can edit in the dialog. The second is the destination:
- New sheet puts the pivot table on its own tab. This is the default for good reasons. A pivot table expands as the data grows, and it needs free cells below and to the right.
- Existing sheet places the top-left corner of the pivot table at a cell you choose. Use this when you want a dashboard layout. Leave the area around it empty.
For a first pivot table, choose New sheet and click Create. Sheets adds a tab named something like Pivot Table 1. It shows an empty grid and opens the pivot table editor on the right.
Step 3: Add fields
The editor has four areas: Rows, Columns, Values, and Filters. You will study each in detail in later chapters. For this first table, use only two.
- Next to Rows, click Add and choose
Region. - Next to Values, click Add and choose
Revenue.
The table now lists each region as a row, and a column holds the revenue total for each. Sheets also adds a Grand total row at the bottom.
Sheets picked SUM because Revenue contains numbers. If the field held text, the default would be COUNTA. That default matters. Always check the Summarize by setting in the Values area, because a wrong function gives a plausible-looking but wrong table.
What the editor stores
A pivot table is not a copy of your data. It is a definition made of four parts: the source range, the grouping fields, the value fields with their functions, and the filters. Sheets applies the definition and shows the result. When the source data changes, the result recalculates.
This has two practical consequences. First, you cannot type over a cell in the pivot output, because the output is regenerated from the definition. Second, if you change a number in the source, the pivot table updates without any action from you.
Reading the result
Suppose the Sales data holds these records:
| Order Date | Region | Product | Units | Revenue |
|---|---|---|---|---|
| 2026-01-14 | West | Notebook | 12 | 144 |
| 2026-01-15 | East | Pen | 40 | 80 |
| 2026-01-20 | West | Pen | 25 | 50 |
| 2026-02-02 | East | Notebook | 8 | 96 |
| 2026-02-09 | North | Notebook | 5 | 60 |
The pivot table with Region in Rows and the sum of Revenue in Values reads:
| Region | SUM of Revenue |
|---|---|
| East | 176 |
| North | 60 |
| West | 194 |
| Grand total | 430 |
Sheets sorts the row labels in ascending order by default. West holds 144 plus 50, which is 194. East holds 80 plus 96, which is 176.
Adding a second dimension
Now click Add next to Columns and choose Product. Each product becomes a column, and each cell holds the revenue for one region and one product. Sheets adds a Grand total column on the right.
| Region | Notebook | Pen | Grand total |
|---|---|---|---|
| East | 96 | 80 | 176 |
| North | 60 | 60 | |
| West | 144 | 50 | 194 |
| Grand total | 300 | 130 | 430 |
The blank cell for North and Pen is not a zero. No record exists for that combination, so Sheets shows nothing. Keep this in mind when you reference such a cell from another formula.
Checking your first result
Never trust a new pivot table until you have checked one number by another route. Pick the West total and calculate it directly from the source data:
=SUMIFS(Sales!E:E, Sales!B:B, "West")For the sample data this returns 194, which matches the pivot table. If the two values differ, something is wrong with the range, the function, or the data. The troubleshooting chapter covers the usual causes. A later chapter also covers GETPIVOTDATA and QUERY, which give you other ways to read and cross-check results.
Common mistakes on a first pivot table
- The source range stops short. If you selected
A1:E100and the data grows past row 100, new rows are missing from the table. Whole-column ranges avoid this. - A blank header cell. The pivot table editor cannot name that field. Fill in every header before you create the table.
- Numbers stored as text. A
Revenuecolumn that Sheets treats as text gets COUNTA, not SUM, and the grand total shows a count of rows. Check that numbers are right-aligned in the source and fix them first. - Blank rows inside the data. A fully blank row can end the automatic selection when you start from a single cell. Delete the blank row or select the range by hand.
- Not enough free space. If you place the table on an existing sheet and cells below or to the right hold data, Sheets reports an error and does not show the table. Move the data or use a new sheet.
- Merged cells in the source. Merged cells leave empty cells in the field, which then groups as blank. Unmerge them and fill the values in.
Reopening the editor
The editor appears only when a cell inside the pivot table is selected. If it disappears, click any cell in the table. To change the source range later, open the editor and edit the range shown under the sheet name at the top of the panel. To delete a pivot table, delete its sheet, or select the whole table and press Delete.
Summary of the workflow
- Confirm that the source data has one header row and no blank headers.
- Select a cell in the data and choose Insert > Pivot table.
- Check the range and choose a destination.
- Add a field to Rows, then a field to Values.
- Check the Summarize by function.
- Verify one value with
SUMIFS.
Exercise
You build a pivot table with Region in Rows and Revenue in Values. The Revenue column shows "COUNTA of Revenue" and the grand total equals the number of records, not a money amount. What is the most likely cause, and how do you fix it?
Show answer
Sheets sees the Revenue values as text, so it chose COUNTA as the default function. Fix the source column so the entries are real numbers (for example by removing currency symbols typed as text or converting the text to numbers). Then change Summarize by to SUM if Sheets does not switch on its own.
Exercise
Your pivot table covers Sales!A1:E100. A colleague adds rows 101 to 120, and the pivot totals do not change. Why, and what is one way to prevent it?
Show answer
The pivot table's source range ends at row 100, so the new rows are outside it. Edit the source range in the editor to include them, or use a whole-column range such as Sales!A:E from the start.
Exercise
In the Region by Product table, the cell for North and Pen is empty. Is the value zero? How would you confirm it with a formula?
Show answer
No. The cell is empty because no record exists for that combination. Confirm with =COUNTIFS(Sales!B:B, "North", Sales!C:C, "Pen"), which returns 0 when there are no matching records.