SDSpreadsheet Diary
excel

Your First Pivot Table, Explained

A beginner walkthrough of what a pivot table does and how to build one in Excel or Google Sheets, based on official Microsoft and Google documentation.

If you have ever built a messy stack of SUMIF formulas just to answer a simple question like "how much did each salesperson sell last month," a pivot table does the same job in a fraction of the time, without a single formula. It has a reputation for being an advanced feature, but the actual mechanics, according to Microsoft's and Google's own documentation, are simpler than most people expect.

What a pivot table actually does

Microsoft's documentation describes a PivotTable as a tool for summarizing, analyzing, exploring, and presenting data, listing specific capabilities including "subtotaling and aggregating numeric data, summarizing data by categories and subcategories" and "moving rows to columns or columns to rows (or 'pivoting') to see different summaries of the source data." Google's help documentation gives a simpler framing: pivot tables let you "narrow down a large data set" and "see relationships between data points," with the specific example of analyzing "which salesperson produced the most revenue for a specific month."

In both cases, the underlying idea is the same: instead of scrolling through hundreds or thousands of raw rows, you tell the pivot table which columns to group by and which numbers to add up, and it rebuilds a compact summary table automatically.

What your source data needs to look like first

Before building a pivot table, Microsoft's documentation is specific about one requirement: "the first row should contain headers that describe the data in the columns with unique names," and there "shouldn't be any blank rows or columns within the data range." Google's instructions state the same requirement directly: "Each column needs a header."

This matters because a pivot table reads your headers to build its own field list. If a column has no header, or if two columns share the same header, the pivot table cannot reliably tell you what that column represents, which leads to mislabeled or broken summaries.

Building a pivot table in Excel

Microsoft's documented steps for Excel:

  1. Click any cell inside your data (it does not need to be formally pre-selected as a table).
  2. Go to the Insert tab and choose PivotTable (Microsoft's guidance also notes a Recommended PivotTable option, which suggests a layout automatically based on your data).
  3. Confirm the data range and choose where the pivot table should appear, either a new worksheet or an existing one.
  4. In the PivotTable Fields pane, select the checkbox next to each field name you want to include.

Once fields are added, Microsoft's documentation explains the default placement logic: "non-numeric fields are added to Rows, date and time hierarchies are added to Columns, and numeric fields are added to Values." You can drag any field to a different area afterward if the default placement is not what you want.

Building a pivot table in Google Sheets

Google's documented steps:

  1. Select the cells containing your source data (remembering that every column needs a header).
  2. In the menu, click Insert, then Pivot table.
  3. In the side panel, next to "Rows" or "Columns," click Add and choose a field.
  4. Next to "Values," click Add and choose the numeric field you want summarized.

Google's documentation also notes that Sheets will sometimes show "recommended pivot tables based on the data you choose," similar to Excel's recommended option, which can be a faster starting point than building the layout manually.

Keeping it updated when your data changes

Both platforms require pivot tables to be refreshed manually when the underlying data changes; a pivot table does not automatically update itself. Microsoft's documentation states plainly: "If you add new data to your PivotTable data source, any PivotTables that were built on that data source need to be refreshed," which you do by right-clicking anywhere inside the pivot table and selecting Refresh.

Google Sheets works slightly differently: its documentation notes that "the pivot table refreshes any time you change the source data cells it's drawn from," meaning edits to existing cells update automatically, but adding entirely new rows below your original selected range may require you to update the pivot table's source range manually.

A simple first project to try

If you have never built one, the fastest way to understand pivot tables is with a small, familiar dataset: a list of expenses with columns for date, category, and amount. Build a pivot table with category in Rows and amount (summarized by SUM) in Values. You will immediately see your scattered expense rows collapse into a clean total per category, which is the same basic mechanic behind more complex pivot tables with multiple row and column fields.

Key takeaways

  • A pivot table summarizes and groups large datasets automatically, without requiring you to write SUMIF, COUNTIF, or similar formulas yourself.
  • Your source data needs a single header row with unique column names and no blank rows or columns, in both Excel and Google Sheets.
  • In Excel, PivotTable fields default to Rows for non-numeric data, Columns for dates, and Values for numbers, though you can rearrange them manually.
  • Neither Excel nor Google Sheets pivot tables update completely automatically; Excel requires a manual Refresh after new data is added, and Sheets requires updating the source range for entirely new rows.
  • Starting with a small, familiar dataset, like a simple expense list grouped by category, is the fastest way to understand how pivot tables work before using them on larger data.

Sources

  1. Microsoft Support, Create a PivotTable to Analyze Worksheet Data
  2. Microsoft Support, Overview of PivotTables and PivotCharts
  3. Google Docs Editors Help, Create & Use Pivot Tables
excelgoogle sheetspivot tablesspreadsheets