What a pivot table does and when you need one
A pivot table is a tool in Excel that takes raw data from a spreadsheet and reorganizes it to show totals, counts, or averages grouped by the categories you choose. Instead of manually sorting and adding formulas, you tell Excel which columns to use as row labels, column labels, and values to calculate — and it builds the summary for you.
You use a pivot table when your data has many rows and you want to see patterns quickly. For example, if you have a list of 500 sales transactions with columns for date, salesperson, region, and amount, a pivot table can show you total sales by region, or sales by salesperson by month, without touching the original data.
The original spreadsheet stays unchanged. The pivot table lives in a separate location — either on a new sheet or elsewhere on the same sheet — and updates if you refresh it after changing the source data.
Key Takeaways
- Your data must have headers in the first row, with each column representing one type of information, and no blank rows or columns mixed in.
- Select all your data including headers, then go to the Insert tab and click Pivot Table to open the dialog.
- Drag fields from the field list into the Rows, Columns, and Values areas to choose what the pivot table shows and how it calculates.
- Excel creates the pivot table on a new sheet by default, but you can choose to place it on the current sheet instead.
- After you change the source data, right-click the pivot table and select Refresh to update the summary with new numbers.
Preparing your data for a pivot table
Before you create a pivot table, your data needs to be organized in a specific way. The first row must contain headers — the names of each column, like "Date", "Product", "Region", or "Sales Amount". Every row below that is one record, and every column is one type of information. There should be no blank rows or columns in the middle of your data, and no extra text or formatting outside the data range.
If your data has blank cells scattered throughout, the pivot table will still work, but it may create an unexpected "Blank" category in your summary. Clean these up before you start. If your headers are in row 1 but your data starts in row 2, that is the correct setup — do not put data in the same row as headers.
You do not need to sort or filter the data first. The pivot table will handle that for you. Just make sure the data is rectangular: same number of columns in every row, and no gaps.
Selecting your data and opening the pivot table dialog
Click any cell inside your data range — you do not have to select every single cell. Excel will automatically detect the boundaries of your data as long as there are no blank rows or columns breaking it up. If you want to be certain, select from the first header cell to the last cell containing data by clicking the first cell, holding Shift, and clicking the last cell.
Once your data is selected (or your cursor is anywhere in the data), go to the Insert tab at the top of the ribbon. Look for the button labeled Pivot Table — in newer versions of Excel it may say "Pivot Table" with a small dropdown arrow next to it. Click it to open the Create PivotTable dialog.
The dialog will show the range of data Excel detected. If the range is wrong, you can type the correct range manually — for example, Sheet1!$A$1:$D$100. Below that, you choose where the pivot table should go: on a new sheet, or on the current sheet at a location you specify. The default is a new sheet, which is usually the cleanest option.
Dragging fields to build your pivot table layout
After you click OK, Excel creates a blank pivot table and opens the PivotTable Fields panel on the right side of the screen. This panel lists all the column headers from your data as clickable fields. Below the field list are four drop zones: Filters, Columns, Rows, and Values.
Drag a field into the Rows area to make that column become the row labels of your pivot table. For example, if you drag "Region" into Rows, each region in your data will become one row. Drag a field into the Columns area to make it spread across the top as column headers — useful for comparing data side by side. Drag a field into the Values area to tell Excel what to calculate: it will sum numbers by default, but you can change it to count, average, or other functions.
You can drag multiple fields into each area. If you put both "Region" and "Product" in Rows, the pivot table will show regions, and under each region, the products sold there. If you put "Month" in Columns and "Sales Amount" in Values, you will see months across the top and sales totals in each cell.
The Filters area at the top lets you add a dropdown to the pivot table so you can show only certain categories — for example, only data from one salesperson or one year. This is optional and useful if your pivot table is large.
Changing how values are calculated
By default, Excel sums numbers in the Values area. If your field contains text or if you want a different calculation, you can change it. Double-click the field name in the Values area — for example, double-click "Sales Amount" — to open the Value Field Settings dialog.
At the top, you will see a list of functions: Sum, Count, Average, Min, Max, and others. Choose the one you need. Sum adds all the numbers. Count tells you how many records are in each group. Average divides the sum by the count. Min and Max show the smallest and largest values. Click OK to apply the change, and the pivot table recalculates immediately.
If you have multiple fields in the Values area, you can set a different function for each one. For example, you might sum sales amounts but count the number of transactions.
Refreshing the pivot table after you change your data
If you go back to your original spreadsheet and add new rows, change numbers, or delete records, the pivot table does not update automatically. You have to refresh it manually. Right-click anywhere inside the pivot table and select Refresh from the menu. The pivot table will recalculate using the updated data.
If you add a new column to your source data after creating the pivot table, that new column will not appear in the PivotTable Fields panel until you refresh. You can also refresh by going to the PivotTable Analyze tab (which appears when you click inside the pivot table) and clicking the Refresh button in the ribbon.
If you delete rows from the source data, the pivot table will no longer show those categories or values the next time you refresh. If you add rows, they will appear in the summary after refresh.
Common adjustments and troubleshooting
If your pivot table shows "Blank" as a category, it means some cells in that column of your source data are empty. Go back to the source data and fill in the missing values, then refresh the pivot table. If you want to hide the Blank category without fixing the source data, right-click it in the pivot table and select Hide.
If a field is not appearing in the PivotTable Fields panel, check that the column header in your source data is spelled correctly and that there are no extra spaces. If the header row is not actually row 1, Excel may not recognize it as a header. You can also click the button labeled "Refresh" in the PivotTable Analyze tab to reload the field list.
If your pivot table is showing unexpected totals, double-check the Values area: make sure the right function is selected (Sum, Count, Average, etc.). If you have multiple fields in Values, each one may be using a different function, which can look confusing at first.
Frequently Asked Questions
Can I edit the data inside the pivot table directly?
No. A pivot table is a summary, not the original data. If you try to type in a cell, Excel will not let you. To change the numbers, go back to the source data, make your edit there, and refresh the pivot table. This protects you from accidentally breaking the summary.
What if I want to move the pivot table to a different location?
Right-click the pivot table, select Move PivotTable, and choose a new sheet or a cell on the current sheet. The pivot table and all its settings move together. You can also cut and paste it like a regular object, though moving it through the menu is more reliable.
Can I use a pivot table with data from multiple sheets?
Not directly. A pivot table works with one contiguous data range. If your data is split across sheets, copy it into one sheet first, then create the pivot table. Alternatively, you can use Power Query to combine the sheets, but that is a more advanced feature.
How do I delete a pivot table?
Right-click the pivot table and select Delete. If the pivot table is on its own sheet, you can also right-click the sheet tab at the bottom and delete the entire sheet. Deleting the pivot table does not affect your original data.
Can I create a pivot chart from a pivot table?
Yes. Click inside the pivot table, go to the Insert tab, and click Chart. Excel will create a chart based on the pivot table's current layout. If you refresh the pivot table, the chart updates automatically.