How to Insert a Pivot Table: Step-by-Step Guide
In this article
To insert a pivot table, select your source data, go to the Insert tab, click PivotTable, choose where you want it placed, and click OK. That creates an empty pivot table frame; you then drag fields into the Rows, Columns, Values, and Filters areas to summarise the data. The exact menu names differ slightly between Excel for Windows, Excel for Mac, and Excel for the web, but the workflow is the same.
What You'll Need
- A spreadsheet application that supports pivot tables: Microsoft Excel (desktop or web), Google Sheets, or LibreOffice Calc. The steps below use Excel because it is the most common, with notes where Sheets differs.
- Source data laid out in a proper table: one header row with unique column names, no blank rows or columns inside the data, and no merged cells.
- Consistent data types in each column (all dates in one column, all numbers in another). Mixed types cause pivot tables to count values instead of summing them.
Step-by-Step
- Clean your source data first. Make sure every column has a header, there are no blank rows or columns, and there are no merged cells. If your data has subtotals or blank separator rows, remove them; a pivot table treats them as data.
- Select the data range. Click any single cell inside your data. If you select the whole range manually, include the header row. Excel will usually detect the surrounding block automatically.
- Go to the Insert tab and click PivotTable. In Excel for Windows and Mac, the button is labelled PivotTable. In Excel for the web, it is also on the Insert tab. A dialog box opens.
- Confirm the data range. The dialog shows the range Excel detected. If it is wrong, either type the correct range or click the collapse button and drag over your data. If your data is in a different workbook, choose that option and select it.
- Choose where to place the pivot table. Select New Worksheet to put it on a fresh sheet (recommended) or Existing Worksheet and click a cell to anchor it. Click OK.
- Drag fields into the four areas. The PivotTable Fields pane appears on the right. Drag a category field (for example, Region) into Rows, another (for example, Month) into Columns, and a numeric field (for example, Sales) into Values. Drag a field into Filters if you want a drop-down to slice the whole table.
- Check the summary type. By default, Excel sums numeric fields and counts text fields. If you see Count instead of Sum, click the field in Values, choose Value Field Settings, and pick Sum. This is the most common fix after inserting a pivot table.
- Format and refresh. Right-click a value and choose Number Format to set currency or decimals. When you change the source data, click anywhere in the pivot table and press Alt+F5 (Windows) or use PivotTable Analyze > Refresh to update it. On Mac, use the Refresh button on the PivotTable tab.
In Google Sheets, the path is Insert > Pivot table, then choose whether to place it on a new sheet or an existing one. The field areas appear on the right, and you add fields by clicking Add next to Rows, Columns, Values, and Filters.
Common Mistakes
- Leaving blank rows or merged cells in the source. Excel may stop detecting the full range, so part of your data is silently excluded.
- Using duplicate or blank column headers. Pivot tables need unique headers; duplicates get renamed automatically (Column1, Column2) and become confusing.
- Storing numbers as text. If a column has numbers stored as text, the pivot table counts them instead of summing them. Convert the column to numbers first.
- Putting a text field in Values. This produces a count, which is sometimes useful but often mistaken for a sum.
- Forgetting to refresh. A pivot table does not update automatically when you edit the source data; you must refresh it.
- Adding new rows outside the original range. If you append data below the original selection, the pivot table will not see it until you change the source range or convert the data to an Excel Table first.
Tips
- Convert your source range to an Excel Table (Ctrl+T on Windows, Command+T on Mac) before inserting the pivot table. Tables expand automatically, so new rows are included when you refresh.
- Use Filters to add a drop-down at the top of the pivot table for slicing by region, product, or date range without rebuilding it.
- Group dates by right-clicking a date field and choosing Group; you can group by month, quarter, or year.
- Use Show Values As to display percentages of total, running totals, or differences, which is often more useful than raw sums.
- Keep one pivot table per sheet if you plan to copy or move it; overlapping pivot tables cause errors.
- Name your source range (Formulas > Define Name) so you can update the pivot table's source in one place later.
Troubleshooting
- The PivotTable button is greyed out. This usually means you are editing a cell, the workbook is protected, or the selection is inside another pivot table. Press Esc, click a single cell in the data, and try again.
- The dialog says the range is not valid. Check for blank headers, merged cells, or a range that includes empty rows. Clear those and retry.
- Values show as Count instead of Sum. The column contains text or blanks. Clean the column, then in the pivot table click the field in Values > Value Field Settings > Sum.
- New data is missing. Refresh the pivot table. If it still does not appear, the source range does not include the new rows; change the range or use an Excel Table.
- Fields are missing from the field list. The source range was probably not expanded. Go to PivotTable Analyze > Change Data Source and reselect the full range.
- The pivot table looks wrong after a refresh. Check for deleted columns or renamed headers in the source; pivot tables rely on header names staying consistent.
Frequently Asked Questions
Can I insert a pivot table from data on another sheet?
Yes. In the Create PivotTable dialog, choose Select a table or range and then click the other sheet and drag over the range, or type the reference with the sheet name.
Does a pivot table update automatically when I change the data?
No. You must refresh it manually (Alt+F5 on Windows, or the Refresh button on the PivotTable tab on Mac). If the source is an Excel Table, new rows are included after a refresh.
Why does my pivot table show Count instead of Sum?
The Values field contains text, blanks, or numbers stored as text. Fix the data type, then change the summary to Sum in Value Field Settings.
Can I use a pivot table in Google Sheets?
Yes. Use Insert > Pivot table, then add fields to Rows, Columns, Values, and Filters in the side panel. The options are slightly different from Excel but the concept is the same.
How many rows can a pivot table handle?
It is limited by the row limit of your spreadsheet application, not by the pivot table itself. Very large datasets may be slow to refresh; filtering the source or using Power Pivot in Excel can help.
Can I delete the source data after inserting a pivot table?
No. The pivot table is a summary that reads from the source range. Deleting or moving the source breaks the pivot table and it will not refresh.