← All cheatsheets
Data Analyst · #058 · September 27, 2026 · 2 min read

How do pivot tables work? The four drop zones that replace 40 SUMIFS

Rows, columns, values, filters, the value settings nobody finds, show-values-as, the source-table rules, and the refresh trap that ships wrong numbers: one page.

Get the free PDF

One page, print-ready, free to share. No signup needed.

Download the PDF

Stop writing 40 SUMIFS. A pivot table is four drag-and-drops that answer the same question, refreshably. One page on the anatomy, the hidden settings, and the cache trap that ships wrong numbers. The print-ready A4 PDF is at the bottom.

The four zones

  • Rows: what you group by.
  • Columns: the second group-by.
  • Values: the number, aggregated.
  • Filters: the slice on top.

Values

  • Sum by default, for numeric columns.
  • Count is what any text-polluted column gets, silently.
  • Right-click a value → Summarize By → average, max, distinct count. Nobody finds it alone.

Show values as

  • % of column total: shares instead of raw sums.
  • Running total: cumulative in one click.
  • Difference from previous: month-over-month without a single formula.

The source

  • One flat table, headers on exactly one row.
  • No merged cells: they break grouping.
  • Ctrl+T first: a real table auto-grows, so new rows join the pivot on refresh.

The same pivot in pandas and SQL

pd.pivot_table(sales,
    index="region",      # rows
    columns="quarter",   # columns
    values="amount",     # values
    aggfunc="sum")

# the SQL twin:
# SELECT region, quarter, SUM(amount)
# FROM sales GROUP BY region, quarter

A pivot table IS a GROUP BY. Explaining one in terms of the other is the cheapest way to prove you understand both.

The trap: the pivot that reports wrong numbers

SymptomCauseFix
new rows missingcache never refreshedRefresh, or Ctrl+T the source
count instead of sumone text cell in the columnclean, re-add the field
category vanishedblank row split the rangedelete it, refresh

Power moves

  • Group dates: right-click → group by months, quarters, years.
  • Double-click any number: the raw rows behind it appear on a new sheet.
  • Slicers: filters your stakeholders can click without breaking anything.

Interview phrasing worth memorizing: a pivot is a snapshot of its cache, not a live view. Refresh is part of the workflow, not an afterthought.

Frequently asked questions

What are the four areas of a pivot table?
Rows (what you group by), columns (the second group-by, spread horizontally), values (the number being aggregated), and filters (the slice applied on top). In database terms a pivot table is a GROUP BY: rows and columns are the grouping keys, values is the aggregate.
Why does my pivot table count instead of sum?
The values column contains at least one cell Excel does not read as a number: a text cell, a number stored as text, or a stray space. Pivots default to COUNT for anything non-numeric. Clean the column (Text to Columns or VALUE), then drag the field out and back in.
Why are my new rows missing from the pivot table?
Pivots read a cached snapshot, not the live sheet. New rows wait until you right-click and Refresh, and they are only included at all if the source range grew. Format the source as a real table (Ctrl+T) so the range auto-grows, and refresh before reading any number that matters.
What is 'Show Values As' in a pivot table?
A second layer of math on the aggregated numbers, without formulas: % of column or row total, running total, difference from previous (month-over-month in one click), and rank. Right-click a value, Show Values As, pick the calculation.

Get the free PDF

One page, print-ready, free to share. No signup needed.

Download the PDF

More cheatsheets