Making a pivot table in Excel takes three steps: get the data into shape, insert the pivot table, and drag fields into the areas that answer your question. The first step matters most. Much of the trouble people have later comes from a messy list.
Prepare the data first
Your list should be one block with a single header row. Give every column its own name, and keep each column to one kind of value. Remove blank rows and blank columns from inside the list, and avoid merged cells in the data.
Numbers that Excel reads as text won’t add up. Signs of text numbers include small green triangles in the corner of a cell, or numbers that line up on the left. The steps for fixing them are in how to convert text to number in excel.
It also helps to turn the list into an Excel table. Click any cell in the list and press Ctrl+T. A table grows as you add rows, and a pivot table built from it can pick up the new rows once you refresh.
If a field you need sits on another sheet, you can bring it into the list with a lookup. For one way to do that, see how to use xlookup in excel.
Insert the pivot table
- Click any cell inside your list.
- Go to the Insert tab and select PivotTable.
- Check the range in the dialog. Excel fills it in from the cell you clicked, or from the table. Adjust it if needed.
- Choose where the pivot table goes. A new worksheet is the simplest choice. Click OK.
Newer versions of Excel also offer Recommended PivotTables on the Insert tab. Excel proposes a few layouts based on your data, which can be a quick starting point.
Place the fields
An empty pivot table appears with a PivotTable Fields pane beside it. Each column heading is listed there. Tick the boxes or drag the names into the four areas:
- Put the field you want to group by, such as Region, in Rows.
- Put the field you want to spread across the top, such as Month, in Columns. Leave it out if you don’t need it.
- Put the number you want to total, such as Amount, in Values.
- Put anything you want to filter by, such as Salesperson, in Filters.
When you tick a box, Excel often places text fields in Rows and number fields in Values. You can drag them anywhere afterward.
Check the calculation
Once Amount is in Values, check its label. If it says Sum of Amount, Excel is adding the values. If it says Count of Amount, it is counting the rows instead. To change it, click the arrow beside the field in the Values area, choose Value Field Settings, and pick the calculation you want.
Format and tidy the layout
The PivotTable Design tab changes the report layout, such as switching to a tabular form that’s easier to read or copy. To change how the numbers look, such as the decimal places or a currency format, open Value Field Settings and choose Number Format.
When the numbers stop matching
A pivot table doesn’t update on its own when the source changes. Select the pivot table, go to the Data tab and choose Refresh All. You can also right-click a value in the pivot table and choose Refresh. If new rows still don’t show, check why is my pivot table not updating.