What a pivot table does and when you need one

A pivot table is a tool in Excel that reorganizes your data to show totals, counts, and patterns without changing the original spreadsheet. Instead of manually adding up rows or filtering by hand, you tell Excel which columns to group by and which numbers to sum, and it builds a new table that answers your question instantly.

You need a pivot table when your data has hundreds or thousands of rows and you want to see it from a different angle — like total sales by region, average order size by month, or how many customers fall into each category. A pivot table does in seconds what would take you an hour to calculate by hand.

The data you start with must be organized in columns with headers at the top. Each row should be one record — one sale, one customer, one transaction. If your data is scattered across cells or missing headers, the pivot table will not work correctly.

Key Takeaways

  • Your data must have column headers and be organized as one record per row before you create a pivot table.
  • Select all your data including headers, then go to Insert > Pivot Table and choose whether to place it in a new sheet or the current one.
  • Drag fields from the list into Rows, Columns, Values, and Filters areas to decide what the pivot table shows and how it groups the data.
  • The pivot table updates automatically if you change the original data, but you must refresh it manually by right-clicking and selecting Refresh.
  • You can filter, sort, and format a pivot table the same way you would a regular table once it is built.

Prepare your data before you start

Before you create a pivot table, check that your data meets three requirements. First, every column must have a header in the top row — "Date", "Region", "Sales Amount", "Product Name", and so on. Second, each row below the headers should represent one complete record with no blank rows in between. Third, the data should not have merged cells or extra formatting that breaks the column structure.

If your data has blank cells scattered throughout, the pivot table will still work but may group those blanks as their own category. If you have totals or subtotals already in your data, remove them before creating the pivot table — the pivot table will calculate its own totals and you do not want duplicates.

Select all your data including the headers. The easiest way is to click the top-left cell of your data, then press Ctrl+Shift+End (on Windows) or Command+Shift+End (on Mac) to select everything to the last cell with data. You can also click one cell in your data range and Excel will auto-detect the boundaries when you create the pivot table.

Create the pivot table and choose where it goes

With your data selected, go to the Insert tab at the top of Excel. Click Pivot Table — it is usually near the left side of the ribbon. A dialog box will open asking where your data is and where you want the pivot table to go.

Excel will show your selected data range in the "Table/Range" field. If it looks wrong, you can correct it by typing the range manually — for example, A1:D500 means columns A through D, rows 1 through 500. Below that, you have two choices: put the pivot table in a new worksheet, or put it in the current worksheet starting at a cell you specify. Most people choose a new worksheet to keep the pivot table separate from the original data.

Click OK. Excel will create a blank pivot table and open the Pivot Table Fields panel on the right side of your screen. This panel lists every column header from your data as a field you can use.

Drag fields into the four areas to build your pivot table

The Pivot Table Fields panel has four drop zones at the bottom: Filters, Columns, Rows, and Values. Each zone controls what the pivot table shows.

Rows is where you put the categories you want to see down the left side of the table. If you drag "Region" into Rows, the pivot table will list each region on its own row. Columns works the same way but puts categories across the top — drag "Month" into Columns and each month becomes a column header. Values is where you put the numbers you want to calculate — drag "Sales Amount" into Values and the pivot table will sum all sales. Filters lets you add a dropdown at the top of the pivot table to show only certain data — drag "Product Name" into Filters and you can then choose to see only one product or all products.

Start simple. Drag one field into Rows and one into Values. For example, drag "Region" into Rows and "Sales Amount" into Values. The pivot table will show each region with its total sales. Then drag another field into Columns — say "Year" — and now you see sales by region and year in a grid. Add more fields as you need them, but start with three or four to keep it readable.

If you drag a field into the wrong zone, just drag it out and drop it in the right place. You can also drag fields around within a zone to change the order — if Rows has both "Region" and "Product", dragging Region below Product will group by Product first, then Region within each product.

Change how numbers are calculated in the Values area

By default, Excel sums numbers in the Values area. If you drag "Sales Amount" into Values, it adds them up. But sometimes you want a different calculation — the average sale, the count of transactions, the highest value, or the lowest.

Double-click the field in the Values area — it will say something like "Sum of Sales Amount". A dialog box opens. Click the dropdown that says "Sum" and choose a different function: Average, Count, Max, Min, or others. Click OK. The pivot table recalculates instantly.

You can also drag the same field into Values multiple times and calculate it different ways. Drag "Sales Amount" into Values twice, then change one to Sum and one to Average. The pivot table will show both columns side by side.

Filter and sort your pivot table

Once the pivot table is built, you can filter and sort it like a regular table. Click the dropdown arrow next to any row or column header to show or hide specific items. If your Rows area has "Region", click the dropdown next to "Region" and uncheck regions you do not want to see — the pivot table updates instantly.

To sort, click any cell in the column you want to sort by, then go to the Data tab and click Sort A to Z or Sort Z to A. You can also right-click a row or column header and choose Sort to get more options.

If you added a field to the Filters area, a dropdown will appear at the top of the pivot table. Use it to show all data or filter to just one category — for example, show only sales from 2024 or only from the North region.

Refresh the pivot table when your data changes

The pivot table does not update automatically when you change numbers in the original data. You have to tell it to refresh. Right-click anywhere in the pivot table and select Refresh. The pivot table recalculates and shows the new totals.

If you add new rows to your original data, the pivot table will not include them until you refresh. If you add a new column, you will need to edit the pivot table's data range — right-click the pivot table, select Pivot Table Options, and update the range to include the new column.

You can also set the pivot table to refresh automatically every time you open the file. Right-click the pivot table, go to Pivot Table Options, and check "Refresh data when opening the file".

Frequently Asked Questions

Can I edit the numbers in a pivot table directly?

No. A pivot table is a summary of your original data, not a copy you can edit. If you need to change a number, go back to the original spreadsheet, make the change there, and then refresh the pivot table. The pivot table will recalculate automatically.

What if my pivot table shows "blank" as a category?

This means some cells in that column are empty. Go back to your original data and fill in the missing values, or delete the blank rows entirely. Then refresh the pivot table and the "blank" category will disappear.

Can I move a pivot table to a different location?

Yes. Select the entire pivot table, cut it (Ctrl+X), click the cell where you want it, and paste (Ctrl+V). The pivot table will move but keep all its settings and data intact.

How do I delete a pivot table?

Click anywhere in the pivot table, then right-click and select Delete. If the pivot table is on its own sheet, you can also right-click the sheet tab and delete the entire sheet. Deleting the pivot table does not affect your original data.

Can I create a pivot table from data in multiple sheets?

Not directly. You need to combine the data into one sheet first, or use a feature called a Data Model. For most situations, copying all the data into one sheet and then creating the pivot table is the simplest approach.