Skip to content

Create a Pivot Table

Premiumadvanced 15 min3 tasks0/54 pts

A PivotTable summarises a table in seconds: pick a field for Rows (what to group by) and a field for Values (what to add up, count or average). Click inside your data, open PivotTable, choose the fields and where to put it.

Common mistakes

  • Leaving blank header cells in the source data.
  • Forgetting to refresh after the source data changes.

When to use a pivot table

A pivot table summarises a long list in seconds: total sales by region, number of orders per customer, hours by project. You do not write formulas. You choose what to group by (Rows) and what to calculate (Values), and Excel builds the table.

Reach for one whenever you are about to write a column of SUMIFS by hand, or when you want to explore data quickly: drag a different field into Rows and the whole summary changes at once.

Pivot tables work best on clean, tabular data: one header row, one record per row, no blank rows or columns, and no merged cells.

Worked example: Total sales by region

An order list has Region, Rep, Product and Sales columns.

RegionRepProductSales
NorthAshaLaptop1,200
SouthBenPhone800
SouthAshaLaptop1,500
NorthChenTablet600
  1. Click any cell inside the data. Excel will detect the whole range.
  2. Go to Insert > PivotTable and choose a new or existing worksheet.
  3. In the field list, drag Region to Rows.
  4. Drag Sales to Values. Number fields are summed by default.
  5. To count orders instead, open Value Field Settings and choose Count.

Result: North 1800, South 2300, and a Grand Total of 4100. The source data is untouched.

Common errors and how to fix them

  • Values show Count instead of Sum

    The column contains text or blank cells, so Excel counts. Clean the column, then switch it to Sum in Value Field Settings.

  • New data does not appear

    Pivot tables do not update on their own. Right-click > Refresh (Alt+F5), and build the pivot from an Excel Table so new rows are included.

  • "The PivotTable field name is not valid"

    A column in the source has a blank header. Give every column a name.

  • The same item appears twice

    The values differ slightly ("North" and "North "). Clean them with TRIM in the source data.

Frequently asked questions

What is a pivot table used for?

Summarising and exploring data: totals, counts and averages grouped by one or more categories, without writing formulas.

How do I refresh a pivot table?

Right-click it and choose Refresh, or press Alt+F5. Ctrl+Alt+F5 refreshes every pivot table in the workbook.

Does a pivot table change my data?

No. It reads the source and builds a separate summary.

Related lessons

Read the lesson, then try it yourself in a live spreadsheet.