Skip to content

Summarize a list with a PivotTable

PivotTables8 min

Builds on Turn a range into an Excel table.

The finance team at a software company in Denver keeps every expense of the quarter in one list, 600 rows long. Before Friday's budget meeting, the CFO wants one total per category, and next week she'll want them per team.

How it works

A PivotTable sorts the rows of a list into groups, one for each value in a column you pick, and adds up a number for each group. Every row whose category is Travel goes into one group, with its amounts added together. You write no formula, and the list stays as it is.

It needs a list in the usual shape: a heading in every column, one row per record, and no blank rows, subtotals or total row inside. Each column becomes a field named after its heading.

  1. Click any cell in the list.
  2. Choose Insert > PivotTable, keep New Worksheet and click OK. Excel adds a sheet with an empty PivotTable and the PivotTable Fields pane.
  3. Check a text field, such as Category. It goes to Rows, one row per category.
  4. Check a number field, such as Amount. It goes to Values as Sum of Amount, with a Grand Total under the categories.

Example

Seven expenses in A1:C8 become a three-row report, with Category in Rows and Amount in Values.

  1. Step 1: Every row whose category is Travel goes into one group, rows 2, 5 and 7.
  2. Step 2: The Travel row adds their amounts, $4,440.
  3. Step 3: Grand Total adds every category, $6,445, the total of the whole list.
Rows with the same category land in one group, wherever they sit in the list, and the PivotTable adds up their amounts.

The PivotTable reads a copy of the list, so refresh it after the list changes, as Refresh a PivotTable and change its source shows.

How to create a pivot table in Excel covers the whole job on one page, from getting the list in shape to filtering with slicers.

Common mistakes

  • A total row left at the bottom of the list. The PivotTable reads it as one more expense, and the Grand Total doubles. Leave it out of the range.
  • A column without a heading. Excel stops with "The PivotTable field name is not valid." Name every column.
  • Count of Amount instead of a sum. A text entry such as "pending", or an empty cell, makes Excel count. Fix it, refresh, and choose Sum in Value Field Settings.
  • A sum of the wrong number, such as unit prices or invoice numbers. Put the amount in Values.

In short

  • A PivotTable groups the rows that share a value and adds up a number for each group.
  • Start from a list with a heading in every column, one row per record, and no total rows inside.
  • Choose Insert > PivotTable, then put a text field in Rows and a number field in Values.

Practice

4 exercises · free, no account needed

Start practicing
  1. Not started

    1. Total the hours for each project

    PivotTable · easy

  2. Not started

    2. Find the spend with each supplier

    PivotTable · medium

  3. Not started

    3. Which list is ready for a PivotTable

    Quiz · easy

  4. Not started

    4. Find the PivotTable command

    Find it · easy