What a pivot table does and why you'd use one

A pivot table takes raw data — rows and columns of numbers, dates, names, or categories — and reorganizes it to show you patterns and totals. Instead of scrolling through thousands of rows to find how much you spent in each category, or which sales rep closed the most deals, a pivot table builds that summary for you in seconds.

The real power is that you can drag fields around to ask different questions of the same data without rewriting formulas. You might start by seeing total sales by month, then swap to see sales by product, then by region, all from the same underlying dataset. This is why pivot tables are the first tool people reach for when they need to understand what their data actually shows.

Key Takeaways

  • A pivot table reorganizes raw data into summaries without changing the original data, letting you see totals, counts, and patterns at a glance.
  • In Excel, you select your data range, go to Insert > Pivot Table, choose where to place it, and drag fields into Rows, Columns, Values, and Filters areas.
  • In Google Sheets, you select data, go to Insert > Pivot Table, then use the editor panel on the right to add rows, columns, values, and filters.
  • The Values area is where the actual math happens — you choose whether to sum, count, average, or use other functions on your numbers.
  • Once built, you can rearrange fields by dragging them between areas, and refresh the pivot table if your source data changes.

Building a pivot table in Excel step by step

Start with your data in a single continuous range — no blank rows or columns in the middle. Your first row should be headers (like "Date", "Product", "Amount", "Region"). Select the entire data range including headers. In Excel 2016 and later, go to the Insert tab and click Pivot Table. A dialog box appears asking where your data is and where you want the pivot table to go. Usually Excel detects your range correctly; if not, type or select it manually. Choose whether to place the pivot table on a new sheet or the current sheet, then click OK.

A blank pivot table frame appears with a panel on the right showing your field names. This panel has four drop zones: Rows, Columns, Values, and Filters. Drag a field into Rows if you want it to label each row (for example, "Product" or "Region"). Drag a field into Columns if you want it to create column headers (for example, "Month" or "Year"). Drag a numeric field into Values — this is where the calculation happens. Excel defaults to summing numbers, but you can change it to count, average, or other functions by double-clicking the field in Values and choosing your function.

The Filters area sits at the top of the pivot table and lets you show only certain categories. For example, if you drag "Region" into Filters, a dropdown appears in the pivot table letting you view only North, only South, or all regions at once. Once your fields are in place, the pivot table populates instantly. If your source data changes, right-click the pivot table and select Refresh to update it.

Building a pivot table in Google Sheets

Google Sheets uses a similar concept but a slightly different interface. Select your data range including headers, then go to Insert > Pivot Table. Google asks you to confirm the data range, then opens a new sheet with a blank pivot table and an editor panel on the right side. The editor has the same four areas: Rows, Columns, Values, and Filters.

Click Add next to Rows and select a field from the dropdown — this becomes your row labels. Click Add next to Columns and select a field for column headers. Click Add next to Values and select a numeric field; Google defaults to summing, but you can click the field name to change it to count, average, minimum, maximum, or other functions. Use Filters the same way: click Add, select a field, and a filter control appears in the pivot table letting you show or hide categories.

Google Sheets updates the pivot table as you add or change fields. If your source data changes, the pivot table updates automatically within a few seconds. You can rearrange fields by dragging them within the editor, or remove a field by clicking the X next to its name.

Choosing what goes in Rows, Columns, and Values

The three main areas control what your pivot table shows. Rows become the leftmost labels — use a categorical field like Product, Region, Department, or Name. Columns become the top headers — often a time field like Month or Year, or another category like Status or Type. Values is where you put the numbers you want to summarize — sales amounts, quantities, hours worked, or counts of records.

A common layout is products in rows, months in columns, and sales amounts in values. This shows you how each product performed each month at a glance. You could swap it to months in rows and products in columns to see the same data from a different angle. The beauty of a pivot table is that you can experiment without breaking anything — just drag fields around and watch the table rebuild.

If you have multiple fields in Rows, the pivot table nests them — for example, Region in the first row area and Product in the second creates a hierarchy where each region shows its products underneath. This is useful for drilling down into detail, but can also make the table harder to read if you have many categories.

Changing how values are calculated

By default, pivot tables sum numeric fields. But sometimes you need a count, an average, a minimum, or a maximum instead. In Excel, double-click the field name in the Values area and a dialog opens. Choose your function from the list — Sum, Count, Average, Min, Max, and others are available. Click OK and the pivot table recalculates.

In Google Sheets, click the field name in the Values area and a menu appears. Select Summarize by and choose your function. You can also add the same field to Values multiple times with different functions — for example, showing both the sum and the count of sales amounts in different columns. This is useful when you want to see both total revenue and number of transactions side by side.

Filtering and sorting a pivot table

Once your pivot table is built, you can filter it to focus on specific data. Any field in the Filters area shows a dropdown button in the pivot table. Click it to show or hide categories — for example, show only Q1 and Q2, or only the North and South regions. You can select multiple categories or use search to find a specific one.

You can also sort rows and columns. In Excel, click a cell in the row or column you want to sort, then use the Data tab's sort buttons. In Google Sheets, click a cell in the row or column and use the Data menu to sort A to Z or Z to A. Pivot tables also let you sort by the values themselves — for example, sorting products by total sales from highest to lowest — which is often more useful than alphabetical order.

Refreshing when your source data changes

If you add new rows to your original data, the pivot table does not automatically include them. In Excel, right-click anywhere in the pivot table and select Refresh. If you added data outside the original range, you may need to edit the pivot table's data source: right-click, select Pivot Table Options, go to the Data tab, and update the range to include the new rows.

In Google Sheets, the pivot table usually updates automatically if you add data within the original range. If it does not, click the refresh icon (circular arrow) in the top right of the pivot table. If you added data outside the original range, you need to edit the pivot table: click the three-dot menu in the top right and select Edit Pivot Table, then update the data range in the editor.

Common mistakes and how to avoid them

The most common mistake is including blank rows or columns in your data range. Pivot tables treat these as separate categories and create confusing extra rows or columns in the result. Clean your data first: delete any blank rows, make sure every column has a header, and check that there are no stray spaces in cell values (a space before or after text makes "North" and " North" look like different categories).

Another mistake is putting a text field in Values expecting it to be counted. Pivot tables count text by default, which is usually what you want, but if you have a field with mixed data types (some numbers, some text), the results can be confusing. Stick to numeric fields in Values unless you specifically want a count.

Finally, do not edit the pivot table directly by typing into cells. Any changes you make are lost when you refresh. If you need to change the underlying data, go back to the source sheet and edit there, then refresh the pivot table.

Frequently Asked Questions

Can I use a pivot table with data from multiple sheets?

In Excel, you can consolidate data from multiple ranges using the Pivot Table dialog's "Multiple consolidation ranges" option, though this is less common. In Google Sheets, you would need to combine the data into a single sheet first using formulas like QUERY or by copying and pasting. Most users find it simpler to merge the source data before building the pivot table.

What if I want to show both the count and the sum of the same field?

Drag the same field into Values twice. In Excel, double-click the first copy and set it to Sum, then double-click the second and set it to Count. In Google Sheets, click the first field, set it to Sum, then click Add again and choose the same field, setting it to Count. The pivot table shows both columns side by side.

How do I remove or hide a pivot table?

In Excel, right-click the pivot table and select Delete. In Google Sheets, click the three-dot menu and select Delete Pivot Table. The source data is not affected — only the pivot table is removed. If you want to keep the data but stop it from updating, copy the pivot table values and paste them as static numbers in a new location.

Can I create a pivot chart from a pivot table?

Yes. In Excel, click inside the pivot table, go to Insert > Chart, and choose your chart type. In Google Sheets, click the three-dot menu and select Create a Chart. The chart updates when you change the pivot table, making it a dynamic way to visualize your summary data.

What if my pivot table shows "Grand Total" rows I do not want?

In Excel, right-click the pivot table, select Pivot Table Options, go to Totals & Filters, and uncheck "Show grand totals for rows" or "Show grand totals for columns". In Google Sheets, click the three-dot menu, select Pivot Table Options, and toggle off the totals you do not want to see.