Pivot tables, explained once
A pivot table turns thousands of rows into a summary you can rearrange by dragging. What it does, how to build one, and the five settings that solve most pivot table problems.

A pivot table summarises a long list (sales, expenses, survey answers) into a compact table of totals, counts or averages, and lets you rearrange that summary by dragging field names. No formulas required. If you just want a summary sheet without opening Excel, the Pivot Table Generator writes one from your file in the browser (as a static table rather than a live PivotTable).
What a pivot table does
Say you have 20,000 rows of sales, one per order: Date, Region, Product, Salesperson, Amount. You want total sales by region and month. You could write SUMIFS formulas for every combination. Or you can let a pivot table group the rows for you:
| Region | Jan | Feb | Mar | Total |
|---|---|---|---|---|
| North | 41,200 | 38,950 | 44,100 | 124,250 |
| South | 35,870 | 40,020 | 39,400 | 115,290 |
Then drag Product to where Region was, and it becomes sales by product. That rearranging, "pivoting", is where the name comes from.
Step 1: get the data ready
Pivot tables are fussy about their source, and almost every problem traces back to it:
- One header row, with a name in every column.
- No blank rows or columns in the middle.
- No totals or subtotals inside the data.
- Numbers as numbers and dates as dates, not text. Text numbers are counted, not summed.
Best of all, turn the data into a table with Ctrl + T. A pivot table built on a table picks up new rows when you refresh, instead of stopping at the original range.
Step 2: insert the pivot table
- Click any cell in the data.
- Insert → PivotTable. Check the range or table name.
- Choose New Worksheet and press OK.
You get an empty pivot table on the left and the PivotTable Fields pane on the right, listing your columns.
Step 3: drag fields into the four areas
- Rows: the categories down the side (Region).
- Columns: categories across the top (Month). Optional.
- Values: the numbers to summarise (Amount). Excel sums numbers and counts text by default.
- Filters: a drop-down above the table to show one slice, such as one Salesperson.
Tick a field and Excel guesses an area; drag it to put it exactly where you want.
Five settings that solve most problems
1. Change Sum to Count or Average. Click the field in Values → Value Field Settings → choose the calculation. If the field shows "Count of Amount" when you wanted a sum, the column contains text or blanks: clean the source and refresh.
2. Show percentages. Value Field Settings → Show Values As → % of Grand Total, % of Column Total, or % Difference From the previous month.
3. Group dates. Put a date field in Rows; recent Excel versions group it into years, quarters and months automatically. To change the grouping, right-click a date → Group. If Group is greyed out, some "dates" in the column are actually text.
4. Refresh. A pivot table does not update when the source data changes. Right-click it → Refresh, or Data → Refresh All. To refresh on opening: PivotTable Analyze → Options → Data → Refresh data when opening the file.
5. Number format. Value Field Settings → Number Format formats the whole field, and the format survives refreshes and rearranging (formatting the cells directly does not).
Slicers: filters people can click
PivotTable Analyze → Insert Slicer adds buttons for a field such as Region. Click a button to filter; Ctrl + click for several. One slicer can drive several pivot tables (right-click it → Report Connections), which is the basis of most simple Excel dashboards.
Pivot table or formulas?
Use a pivot table to explore and to summarise by categories that change. Use SUMIFS when the summary has a fixed layout that must stay put, or feeds other calculations. Pivot tables move when they are refreshed, so formulas that point into them break easily; GETPIVOTDATA exists for that, but a SUMIFS on the source is often simpler. The SUMIF Generator writes those for you.
Common errors
- "The PivotTable field name is not valid": a column in the source has no header.
- Blank or "(blank)" rows: the source range includes empty rows. Use a table, or fix the range in PivotTable Analyze → Change Data Source.
- Old items still in the filter list: PivotTable Options → Data → Number of items to retain per field → None, then refresh.
Clean source data prevents most of these. The Excel Data Cleaner trims spaces and converts text numbers before you pivot.


