Sub topic 4
Inserting a PivotTable
This chapter assumes you can navigate workbooks and worksheets, and that your data is a flat table with one header row and one record per row. It also assumes you know how to turn a range into an Excel Table. You will create an empty PivotTable from that data and confirm it is wired to the right source.
What you need before you insert
Start with the sample data below. Each row is one sale, and each column has a single header.
Date,Region,Product,Units,Sales
2025-01-05,East,Widget,10,250
2025-01-12,West,Gadget,4,180
2025-02-03,East,Gadget,7,315
2025-02-14,West,Widget,12,300
2025-03-09,East,Widget,5,125Before you insert, check three things:
- Every column has a unique, non-blank header.
- There are no fully blank rows or columns inside the data.
- Numeric columns contain real numbers, not text.
If any of these fail, Excel may guess the wrong range or treat numbers as text. Chapter-level fixes for these problems appear in the troubleshooting chapter.
Steps to insert
- Click any single cell inside the data. Do not select the whole sheet.
- On the Insert tab, choose PivotTable, then From Table/Range.
- In the dialog, check the Table/Range box. For an Excel Table it shows the table name, such as
Table1. For a plain range it shows a reference such asSheet1!$A$1:$E$6. - Choose where to put the report. New Worksheet is the safer default, because the PivotTable can grow without overwriting other cells. Existing Worksheet places it at a cell you choose.
- Select OK.
Excel adds a new sheet with an empty PivotTable placeholder and opens the PivotTable Fields pane on the right. Nothing is summarised yet. You build the report in the next chapter by dragging fields into the four areas.
Range or Table as the source
The dialog accepts either, but the choice affects later work.
| Source | What the dialog shows | When new rows are added |
|---|---|---|
| Excel Table | The table name, for example `Table1` | The PivotTable picks them up on refresh |
| Plain range | A fixed reference, for example `Sheet1!$A$1:$E$6` | They are ignored until you change the data source |
Use an Excel Table when the data will grow. That avoids the common problem of a PivotTable that silently leaves out recent records.
Common errors at this step
- "The PivotTable field name is not valid." A header cell is blank. Fill in every header and insert again.
- The Fields pane is missing. Click inside the PivotTable placeholder. If the pane is still hidden, open the PivotTable Analyze tab and choose Field List.
- The wrong columns are included. The range was detected incorrectly. Cancel and select a cell inside the data, or type the correct range in the dialog.
Exercise
You insert a PivotTable from a plain range, and next week 20 new rows are added below the data. Why might they be missing from the report, and what change at the source would prevent this?
Show answer
A plain range gives a fixed reference such as Sheet1!$A$1:$E$6, so rows added below it fall outside the source. Converting the data to an Excel Table before inserting, so the source is the table name, lets the PivotTable include new rows when it is refreshed.