What a pivot table does and why you might need one
A pivot table takes a large, flat list of data — like sales records with dates, regions, and amounts — and reorganizes it so you can see totals and patterns without writing formulas. Instead of manually adding up all sales by region or month, a pivot table does that grouping for you in seconds. You drag column headers into different zones (rows, columns, values) and the table rebuilds itself to show whatever breakdown you want.
The main reason to use a pivot table instead of formulas is speed and flexibility. If you have 5,000 rows of transaction data and you want to see totals by product category, then by salesperson, then by both at once, a pivot table lets you rearrange those groupings by dragging. With formulas, you would rebuild the whole calculation each time. Pivot tables also handle the counting and summing automatically, so you do not have to write SUMIF or COUNTIF functions yourself.
Key Takeaways
- A pivot table groups and summarizes data from a flat list, showing totals by category without requiring formulas.
- In Excel, you select your data range, go to Insert > Pivot Table, choose where to place it, and drag fields into the Rows, Columns, and Values areas.
- In Google Sheets, you select your data, go to Insert > Pivot Table, and use the same drag-and-drop interface to arrange your summary.
- Your original data must have headers in the first row, and each column should contain one type of information (dates in one column, amounts in another).
- You can change what a pivot table shows by dragging fields between areas or removing them entirely — the table updates when ready.
Preparing your data before you build a pivot table
Pivot tables work best when your data is organized in a straightforward, consistent format. Each column should have a header in the first row — something like "Date", "Region", "Product", "Amount". Every row below that should contain one record, with the same type of information in each column. If your dates are sometimes written as "Jan 5" and sometimes as "1/5/2024", the pivot table may treat them as separate values instead of grouping them together.
Remove any blank rows or columns within your data range before you start. If you have a total row at the bottom of your list, delete it — the pivot table will calculate its own totals. You do not need to sort or filter the data first; the pivot table will handle that. Just make sure every cell in a column contains the same kind of information, with no stray text or numbers mixed in where they do not belong.
Creating a pivot table in Excel
Select all your data, including the header row. The easiest way is to click any cell in your data, then press Ctrl+A (Windows) or Cmd+A (Mac) — Excel will select the entire data range automatically. Go to the Insert tab at the top, then click Pivot Table. A dialog box will appear asking where you want to place the pivot table. Choose New Worksheet if you want it on a separate sheet, or Existing Worksheet if you want it on the same sheet as your data. Click OK.
A blank pivot table frame will appear on the right side of your screen, with a list of your column headers below it. You will see four zones: Rows, Columns, Values, and Filters. Drag a field (like "Region") into the Rows area to list each region as a separate row. Drag another field (like "Amount") into the Values area, and Excel will sum those amounts by region automatically. If you want to break it down further — say, by month within each region — drag "Date" into the Columns area. The pivot table will rebuild itself to show that layout.
To change what the pivot table shows, drag fields between the four zones or remove them by dragging them out. If you want to see a count of transactions instead of a sum of amounts, double-click the field in the Values area and change the function from Sum to Count. The table updates when ready.
Creating a pivot table in Google Sheets
Select all your data including headers. Go to the Insert menu and click Pivot Table. Google Sheets will ask you to confirm the data range — it usually gets it right, but check that the range includes all your rows and columns. Click Create. A new sheet will open with a blank pivot table editor on the right side.
The interface is nearly identical to Excel. You will see a list of your fields on the left, and four zones on the right: Rows, Columns, Values, and Filters. Drag "Region" into Rows, "Amount" into Values, and "Date" into Columns to create the same layout as the Excel example. Google Sheets sums the values by default, but you can click the field in the Values area to change it to count, average, or another function.
One difference from Excel: Google Sheets creates the pivot table on a new sheet automatically. You cannot place it on the same sheet as your original data. If you want to move it later, you can copy the pivot table and paste it elsewhere, but it will become a static table rather than a live pivot table that updates when your data changes.
Changing what your pivot table shows
Once your pivot table exists, you can rearrange it without starting over. If you want to see totals by salesperson instead of by region, drag "Salesperson" into the Rows area and drag "Region" out. If you want to add a filter so you can show only certain products, drag "Product" into the Filters area. A dropdown will appear at the top of the pivot table where you can select which products to include.
To change how values are calculated, click the field in the Values area. In Excel, click the dropdown arrow next to the field name. In Google Sheets, click the field itself. You will see options like Sum, Count, Average, Min, and Max. Choose whichever makes sense for your data. If you are working with amounts of money, Sum is usually correct. If you are counting how many transactions happened in each region, use Count.
If your original data changes — new rows are added, or numbers are updated — the pivot table will not update automatically in Excel. You need to right-click the pivot table and select Refresh. In Google Sheets, the pivot table updates automatically as long as the original data is on the same spreadsheet.
Common mistakes and how to fix them
The most common problem is that a pivot table treats similar values as different groups. This usually happens when your data is inconsistent — "New York" in one row, "new york" in another, or "New York " with an extra space. The pivot table sees these as three separate regions and creates three rows instead of one. Before you build the pivot table, use Find and Replace (Ctrl+H or Cmd+H) to standardize your data. Search for "new york" and replace all instances with "New York" so they match exactly.
Another issue is that dates appear as numbers instead of being grouped by month or year. This usually means your date column contains text that looks like a date, not an actual date value. If you see dates like "01-05-2024" that the pivot table treats as separate values, you may need to convert them to proper date format first. In Excel, select the column, go to Data > Text to Columns, and choose the date format that matches your data. In Google Sheets, select the column and go to Format > Number > Date.
If your pivot table shows "Count of [field]" instead of "Sum of [field]" when you expected a sum, the values in that column may contain text mixed in with numbers. Check your original data for any cells that have text like "USD 500" instead of just "500". Clean those up, refresh the pivot table, and change the function back to Sum.
When a pivot table is not the right tool
Pivot tables are powerful for summarizing data, but they are not the best choice for every task. If you need to create a detailed report that shows every individual transaction with some calculations added, a pivot table will hide the detail. Use formulas instead, or add a helper column with a SUMIF formula that pulls in totals without hiding the original rows.
If your data changes constantly and you need the summary to update in real time without manual refresh, Google Sheets is better than Excel because it updates automatically. If you need to share a summary with someone who should not see the underlying data, a pivot table is actually a good choice — you can delete the original data sheet and share only the pivot table, and they will see the summary without access to the raw records.
Frequently Asked Questions
Can I create a pivot table from data on multiple sheets?
In Excel, you can only build a pivot table from data on a single sheet. If your data is split across multiple sheets, you need to combine it into one sheet first. In Google Sheets, you can reference data from multiple sheets using a formula like QUERY or IMPORTRANGE, then build a pivot table from the combined result, but it is more complex than working with a single data range.
What if I want to show both the count and the sum of the same field?
Drag the same field into the Values area twice. The first instance might be set to Sum, and the second to Count. The pivot table will show both calculations side by side. In Excel, you may need to rename one of them so they do not both say "Sum of Amount" — right-click the field and choose Value Field Settings to change the label.
Can I delete a pivot table and start over?
Yes. In Excel, right-click anywhere in the pivot table and select Delete, then choose Entire Pivot Table. In Google Sheets, right-click the sheet tab and select Delete Sheet if the pivot table is on its own sheet, or select all cells in the pivot table and press Delete to clear it. Your original data will not be affected.
How do I sort a pivot table by the values instead of alphabetically?
Click any cell in the row or column you want to sort, then go to Data > Sort (in both Excel and Google Sheets). Choose whether to sort ascending or descending. The entire pivot table will reorganize so the largest or smallest values appear first, depending on what you chose.