What a pivot table does and why you need one

A pivot table takes a large, flat list of data — like a spreadsheet with hundreds of rows — and reorganizes it into a summary that shows patterns. Instead of scrolling through raw numbers, you get totals grouped the way you choose: sales by region, expenses by month, customer counts by product type. The pivot table does the math for you and updates instantly if you change the source data.

You build a pivot table by telling the software which columns to use as row labels, which to use as column headers, and which numbers to add up. The software handles the grouping and calculation. This works the same way in Excel and Google Sheets, though the steps differ slightly.

Key Takeaways

  • A pivot table summarizes raw data by grouping it the way you choose and calculating totals automatically.
  • Your data must have headers in the first row, with no blank rows or columns mixed in.
  • In Excel, you select your data and use the Insert menu; in Google Sheets, you use the Data menu.
  • After the pivot table is created, you drag fields into rows, columns, and values areas to shape the summary you want.
  • Pivot tables stay linked to the original data, so changes to the source automatically update the summary.

Preparing your data before you start

Pivot tables work only if your data is organized in a specific way. The first row must contain headers — the column names that describe what each column holds. Every row below that should contain actual data with no blank rows in the middle. If your spreadsheet has extra text, notes, or formatting above the headers, delete those first.

Check that each column contains only one type of information. A "Date" column should hold only dates, a "Sales" column only numbers. If a column mixes text and numbers, the pivot table will treat them as separate groups. Remove any completely blank columns from your data range before you start, because the software may include them in the pivot table and create confusing empty sections.

Creating a pivot table in Excel

Start by clicking any cell inside your data range — you do not need to select the entire table. Go to the Insert menu at the top and look for Pivot Table. Click it. Excel will show you a dialog asking which data range to use; it usually guesses correctly based on where you clicked. You can also choose whether the pivot table appears on a new sheet or the current sheet. Most people choose a new sheet to keep the summary separate from the raw data.

Click OK or Create. Excel opens a blank pivot table on the new sheet and shows a panel on the right side listing all your column names as fields. Below that are four boxes labeled Rows, Columns, Values, and Filters. To build your summary, drag field names from the list into these boxes. Drag a field to Rows if you want it as a row label (like "Region"). Drag a field to Columns if you want it as a column header (like "Month"). Drag a field to Values if you want it summed or counted (like "Sales Amount").

As you drag fields into place, the pivot table fills in on the left. If the result is not what you expected, drag fields out of the boxes to remove them, or drag them to a different box. There is no penalty for experimenting — the pivot table updates instantly as you rearrange.

Creating a pivot table in Google Sheets

Click any cell in your data range. Go to the Data menu and select Pivot table. Google Sheets asks you to confirm the data range, then opens a new sheet with a blank pivot table and a panel on the right. The panel works the same way as Excel: you see your field names listed at the top, and below that are sections for Rows, Columns, Values, and Filters.

Drag fields from the list into the sections you want. If you drag "Product" to Rows, each product becomes a row label. If you drag "Quarter" to Columns, each quarter becomes a column header. If you drag "Revenue" to Values, Google Sheets sums the revenue for each combination of row and column. The pivot table updates as you work, so you see the result immediately.

One difference from Excel: in Google Sheets, you can click a field name in the Values section to change how it is calculated. By default, Google Sheets sums numbers and counts text. If you want an average instead of a sum, or a count instead of a sum, click the field and choose a different function from the menu.

Changing how the pivot table calculates and displays data

After you build the basic structure, you may want to change what calculation the pivot table uses. In Excel, right-click a number in the Values area and choose Summarize Values By to pick Sum, Count, Average, Min, Max, or other options. In Google Sheets, click the field name in the Values section and select a function from the dropdown.

You can also add multiple fields to the same section. For example, drag two different date fields to Rows if you want the data grouped first by year, then by month within each year. The order matters: the first field you add becomes the outermost grouping. Drag fields up or down within a section to change the order.

If you want to hide certain rows or columns — for example, showing only the top three regions instead of all ten — look for filter buttons that appear in the pivot table itself. Click the dropdown arrow next to a row or column header and uncheck the items you want to hide. The hidden data is still there; you are just not viewing it.

Updating the pivot table when your source data changes

The pivot table stays connected to the original data. If you go back to the source sheet and change a number, add a new row, or delete a row, the pivot table does not update automatically in all cases. In Excel, right-click anywhere in the pivot table and choose Refresh. In Google Sheets, the pivot table usually updates on its own within a few seconds, but you can also click the refresh icon (a circular arrow) at the top of the pivot table panel if you want to force an update immediately.

If you add new columns to your source data, the pivot table will not see them until you tell it to. In Excel, right-click the pivot table and choose Pivot Table Options, then update the data range. In Google Sheets, click the pivot table, go to the Data menu, and select Update range. After that, the new columns appear in the field list on the right, and you can drag them into your pivot table.

Common mistakes and how to fix them

The most common problem is blank rows or columns in the source data. If your original spreadsheet has a blank row in the middle, the pivot table may treat the data above and below as separate tables. Go back to the source sheet, find and delete any blank rows, then refresh the pivot table. The second common mistake is forgetting that the first row must be headers. If your data starts with actual values instead of column names, the pivot table will treat the first row as data and create confusing labels.

Another frequent issue is dragging the wrong field to Values. If you drag a text field like "Region" to Values, the pivot table counts how many times each region appears instead of summing a number. If that happens, drag the text field out of Values and drag a numeric field in instead. If you accidentally create a pivot table on the wrong sheet or with the wrong data range, the simplest fix is to delete the pivot table sheet and start over — it takes only a minute.

Frequently Asked Questions

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

Not directly. You must first combine the data into a single sheet, then build the pivot table from that combined range. If the data is in the same format across sheets, copy and paste all rows into one sheet, keeping the headers from the first sheet only.

What if my pivot table shows "Grand Total" but I only want subtotals?

In Excel, right-click the pivot table, choose Pivot Table Options, and uncheck the boxes for grand totals. In Google Sheets, click the pivot table, then in the editor panel on the right, look for options to show or hide totals. You can usually toggle them on and off without rebuilding the table.

Can I sort the rows or columns in a pivot table?

Yes. Click any value in the row or column you want to sort, then use the sort buttons in the toolbar (A to Z or Z to A). The entire pivot table rearranges based on that column. In Google Sheets, you can also click the dropdown arrow next to a row or column header and choose a sort option directly.

What happens if I edit a number inside the pivot table itself?

Do not edit numbers inside the pivot table. Changes you make there do not update the source data, and the next time you refresh the pivot table, your edits disappear. Always edit the original data in the source sheet, then refresh the pivot table to see the change reflected in the summary.

Can I copy a pivot table and paste it as regular data?

Yes. Select the entire pivot table, copy it, then right-click in a new location and choose Paste Special, then Values Only. This creates a static snapshot of the pivot table that will not update if the source data changes. Use this when you want to share a summary that should not change.