Creating a Pivot Table in Excel: A Step-by-Step Guide
Pivot tables are one of Excel's most powerful features, yet many people avoid them because they look complicated. In reality, creating a pivot table takes less than a minute once you know the steps. This guide walks you through the whole process using a real-world example: a pensioner payroll dataset from Snips Housing Association, showing how to turn hundreds of rows of payment data into a clear, interactive summary.
What you will learn
- What a pivot table is and why it is useful
- How to prepare your data before creating a pivot table
- How to insert a pivot table and configure rows, columns and values
- How to group, filter and sort your results
- How to refresh a pivot table when your data changes
- Common mistakes and how to avoid them
The example dataset: Snips Housing Association pensioner payroll
Snips Housing Association pays a monthly pension supplement to retired staff. The payroll team maintains a spreadsheet with one row per payment. Here is a sample of what the data looks like:
| Payee ID | Payee Name | Department | Payment Month | Payment Type | Amount (£) |
|---|---|---|---|---|---|
| P001 | Margaret Okafor | Housing | Jan 2025 | Standard Pension | £1,240.00 |
| P002 | Derek Simmons | Finance | Jan 2025 | Enhanced Pension | £1,680.00 |
| P003 | Sylvia Patel | Housing | Jan 2025 | Standard Pension | £1,240.00 |
| P004 | Norman Clarke | Maintenance | Jan 2025 | Standard Pension | £1,240.00 |
| P005 | Irene Walsh | Finance | Feb 2025 | Enhanced Pension | £1,680.00 |
| P006 | Arthur Mensah | Housing | Feb 2025 | Standard Pension | £1,240.00 |
| P007 | Doris Thornton | Maintenance | Feb 2025 | Enhanced Pension | £1,680.00 |
| P008 | Reginald Obi | Housing | Mar 2025 | Standard Pension | £1,240.00 |
The full dataset has 96 rows — one payment per pensioner per month across a full year. Scrolling through 96 rows to answer questions like 'how much did we pay the Housing department in total?' is slow and error-prone. A pivot table answers that in seconds.
Step 1 — Prepare your data
Before inserting a pivot table, your data needs to be in the right shape. Each column must have a clear header in row 1 — for example, Payee ID, Payee Name, Department, Payment Month, Payment Type and Amount. There should be no blank rows or merged cells within the data, and every row should represent one record (in this case, one payment).
In the Snips payroll spreadsheet, the data runs from cell A1 to F97 — one header row and 96 payment rows. The team formatted it as an Excel Table by clicking any cell in the data and pressing Ctrl+T. This gives the table a name (Table1 by default) and makes it easier to manage.
Tip: Always format your data as an Excel Table (Insert > Table) before creating a pivot table. This means the pivot table will automatically include new rows when you refresh it.
Step 2 — Insert the pivot table
Click any cell inside your data. Go to the Insert tab on the ribbon and click PivotTable. The 'Create PivotTable' dialogue box will appear. Excel will automatically detect your data range — if you formatted your data as a Table, it will show the table name (e.g. Table1) rather than a cell range.
Choose 'New Worksheet' to place the pivot table on a separate sheet — this keeps your raw data clean and makes it easier to share the summary. Click OK. Excel creates a blank pivot table on a new sheet and opens the PivotTable Fields pane on the right-hand side.
Step 3 — Build your first view: total paid by department
The PivotTable Fields pane lists all your column headers at the top. Below that are four areas: Filters, Columns, Rows and Values. You build the pivot table by dragging fields into these areas.
To see the total amount paid to each department, drag Department to the Rows area and Amount to the Values area. Excel will immediately show a table with one row per department and the total payment for each. For the Snips dataset, you would see Housing, Finance and Maintenance listed with their respective totals.
By default, Excel sums numeric fields. If it shows 'Count of Amount' instead of 'Sum of Amount', click the dropdown arrow next to the field in the Values area, choose Value Field Settings, and change the calculation to Sum.
Tip: If the PivotTable Fields pane disappears, click anywhere inside the pivot table to bring it back.
Step 4 — Add a second dimension: break down by payment type
Now drag Payment Type to the Columns area. The pivot table expands to show a column for each payment type — Standard Pension and Enhanced Pension — with the department totals broken down across both. A Grand Total column on the right shows the overall total per department.
This single view answers several questions at once: which department has the highest total pension cost, how many pensioners are on the enhanced rate in each department, and what the overall payroll looks like. The Snips payroll manager can now see at a glance that Housing has the largest headcount but Finance has a higher average payment because more of its pensioners are on the enhanced rate.
Step 5 — Filter by month
Drag Payment Month to the Filters area. A filter dropdown appears above the pivot table. Click the dropdown and select a specific month — for example, March 2025. The table instantly updates to show only payments made in that month.
This is particularly useful for month-end reporting. The Snips payroll team uses this filter to produce a one-page summary for each monthly payroll run, without needing to create a new spreadsheet each time.
Tip: You can add multiple fields to the Filters area to create a more specific view — for example, filtering by both month and payment type at the same time.
Step 6 — Count payments instead of summing amounts
Sometimes you want to count records rather than sum a value. To count the number of pensioners paid in each department, remove Amount from the Values area and drag Payee ID there instead. Click the dropdown next to the field in Values, choose Value Field Settings, and change the calculation to Count.
The pivot table now shows the number of payments per department per payment type. Combined with the month filter, this gives the payroll team a quick headcount check — useful for spotting if anyone has been missed or paid twice.
Step 7 — Refresh when your data changes
Pivot tables do not update automatically when the underlying data changes. If the payroll team adds April 2025 payments to the spreadsheet, the pivot table will not show them until it is refreshed.
To refresh, right-click anywhere inside the pivot table and choose Refresh. Alternatively, go to the PivotTable Analyse tab on the ribbon and click Refresh. If you have multiple pivot tables in the workbook, click Refresh All to update them all at once.
Tip: If you formatted your data as an Excel Table before creating the pivot table, new rows added to the bottom of the table will be included automatically when you refresh — you do not need to update the data source manually.
What the finished pivot table looks like
After completing steps 3 and 4, your pivot table will look something like this (figures are illustrative based on the Snips dataset):
| Department | Enhanced Pension | Standard Pension | Grand Total |
|---|---|---|---|
| Finance | £20,160.00 | £4,960.00 | £25,120.00 |
| Housing | £6,720.00 | £29,760.00 | £36,480.00 |
| Maintenance | £10,080.00 | £9,920.00 | £20,000.00 |
| Grand Total | £36,960.00 | £44,640.00 | £81,600.00 |
Where to go next
Now you know how to build a pivot table, the next step is turning your summary data into a visual dashboard using charts and slicers.
Introduction to Dashboards and Data Visualisation →