Sub topic 3
How values are summarized
This chapter explains what Google Sheets does to the numbers in the Values area of a pivot table. It assumes you can already create a pivot table, drag fields into Rows, Columns, Values and Filters, and use SUM, COUNT and AVERAGE in ordinary cell formulas. The next chapters build grouping and calculated fields on this behavior, so it helps to know it well.
The running example
All examples use the same five-row table. Paste it into a sheet with the headers in row 1, then insert a pivot table from the whole range.
Date Region Product Units Revenue Cost
2026-01-05 West Widget 10 250 150
2026-01-19 East Widget 4 100 60
2026-02-02 West Gadget 7 420 245
2026-02-23 South Gadget 3 180 105
2026-03-09 East Gizmo 12 600 420Put Region in Rows and Revenue in Values. Sheets shows one row per region, plus a grand total row.
What a value cell is
A pivot value cell is an aggregate. For each cell, Sheets does three things:
- It finds the source rows that match the row and column items, and any active filters.
- It takes the values of the chosen source column from those rows.
- It applies the Summarize by function to those values and shows the single result.
The grand total follows the same process. It applies the function to all matching source rows, not to the numbers displayed above it. This difference matters for every function except SUM, as the AVERAGE section below shows.
Choosing the function
Each field in Values has a Summarize by dropdown. The list depends on the data type, but the common choices are these.
| Function | What it returns | Counts blanks? | Notes |
|---|---|---|---|
| SUM | Total of the numbers | Ignores them | Default for numeric columns |
| COUNTA | Number of non-empty cells | No | Default for text columns |
| COUNT | Number of numeric cells | No | Skips text and blanks |
| COUNTUNIQUE | Number of distinct values | No | Works on text and numbers |
| AVERAGE | Mean of the numbers | Ignores them | Blanks do not count as zero |
| MAX, MIN | Largest, smallest number | Ignores them | |
| MEDIAN | Middle number | Ignores them | |
| PRODUCT | Numbers multiplied together | Ignores them | Rarely useful |
| STDEV, STDEVP | Sample or population standard deviation | Ignores them | |
| VAR, VARP | Sample or population variance | Ignores them | |
| CUSTOM | A formula you write | Depends | Available for calculated fields |
The CUSTOM option is the subject of a later chapter. For now, note that the others apply one function to one source column.
SUM, COUNT and AVERAGE on the example
With Region in Rows, you can add Revenue to Values three times, using a different function each time. A field can appear in Values more than once. The results are:
| Region | SUM of Revenue | COUNTA of Revenue | AVERAGE of Revenue |
|---|---|---|---|
| East | 700 | 2 | 350 |
| South | 180 | 1 | 180 |
| West | 670 | 2 | 335 |
| Grand Total | 1550 | 5 | 310 |
Check the AVERAGE grand total. The mean of the three regional averages is (350 + 180 + 335) / 3 = 288.33, but the pivot shows 310. That is the mean of all five revenue values (1550 / 5). The grand total is computed from the source rows, which is usually what you want, but it surprises people who expect the totals row to be a roll-up of the rows above it.
COUNT versus COUNTA versus COUNTUNIQUE
These three answer different questions, and the right choice depends on what you want to know.
- COUNTA answers "how many records have a value here?" Add Product to Values and the default is COUNTA. West gets 2, East gets 2, South gets 1.
- COUNT answers "how many numbers are there?" On a text column it returns 0. On a numeric column it matches COUNTA only if there are no text entries or stray notes.
- COUNTUNIQUE answers "how many different values?" For Product by Region, West has Widget and Gadget (2), East has Widget and Gizmo (2), and South has Gadget (1). The grand total is 3, because the table has three distinct products. It is not 5, which is what adding the rows would give you.
The last point shows the same effect as AVERAGE. The regional counts here are 2, 2 and 1, which add up to 5, yet the grand total is 3.
Same data, different summaries
The function you choose changes the story the pivot tells. Consider Revenue per Region again, now with MAX and MEDIAN:
| Region | MAX of Revenue | MEDIAN of Revenue |
|---|---|---|
| East | 600 | 350 |
| South | 180 | 180 |
| West | 420 | 335 |
| Grand Total | 600 | 250 |
The East median is 350 because with only two values the median is their midpoint (100 and 600). The grand total median is 250, the middle of the five sorted values 100, 180, 250, 420 and 600. Medians on small groups with two values behave like averages. They become more informative as groups grow.
Show as: changing the display, not the math
Below the Summarize by dropdown there is a Show as dropdown. Its options are Default, % of row, % of column and % of grand total. Show as takes the result of the summary and divides it by a total. It does not change the function.
For SUM of Revenue by Region with % of grand total:
| Region | SUM of Revenue | Shown as % of grand total |
|---|---|---|
| East | 700 | 45.2% |
| South | 180 | 11.6% |
| West | 670 | 43.2% |
| Grand Total | 1550 | 100% |
The percentages are 700/1550, 180/1550 and 670/1550. When you also have a field in Columns, % of row makes each row add to 100% and % of column makes each column add to 100%.
Show as pairs naturally with SUM and COUNTA, because their totals are additive, so the percentages add up cleanly. With AVERAGE, a percentage of the grand total compares each group's mean to the overall mean, which is rarely what a reader expects. Use it only deliberately.
A common pattern is to add the same field twice: once as SUM with the default display, and once as SUM with % of grand total. Rename the second field's header so readers can tell them apart.
Renaming and formatting value fields
By default a value column is titled something like "SUM of Revenue". Each value field has a text box where you can change this label. Editing the label does not change the calculation. It is good practice to rename any field that appears twice, such as "Revenue" and "Revenue share".
Number formatting is separate. The pivot table output cells take formatting like normal cells, so select the cells and apply a currency or percent format. Be aware that when the pivot table is refreshed and the layout changes, the formatted area may no longer match the new data. Applying the format to a larger range, or setting the format on the whole column, avoids that.
Why a summary shows an unexpected value
Several common problems look like a wrong function but come from the data.
- Text numbers. If Revenue contains values stored as text (for example, imported with a leading apostrophe), SUM returns 0 and COUNTA still counts them. Sheets also defaults such a column to COUNTA, which is a clue. Convert the column to real numbers.
- Blank cells. Blanks are skipped by AVERAGE, MIN and MAX. A group with ten rows and two blanks averages over eight values. If blank should mean zero, fill the zeros in the source.
- Mixed columns. A column that contains both numbers and text notes can be summarized by COUNT (numbers only) or COUNTA (everything). The two counts will differ, and the difference is the number of text entries.
- Total rows in the source. If the source range includes a "Total" row, SUM double-counts. Keep totals outside the range you give the pivot table.
- Stale range. If you add rows below the source range and the pivot does not include them, extend the data range in the pivot editor.
Choosing a function: a checklist
- Ask what question the cell should answer: a total, a count of records, a count of distinct items, a typical value or an extreme.
- Check the column type. Totals and averages need real numbers; counting works on anything.
- Decide whether the grand total should be additive. If it should, prefer SUM or COUNTA. If you choose AVERAGE or COUNTUNIQUE, expect a grand total computed from the source rows.
- Decide whether the reader needs absolute numbers, shares, or both. If both, add the field twice and use Show as on one copy.
- Rename the field so the heading says what it is.
Ratios such as profit margin do not fit this model neatly. Averaging a per-row margin gives each row equal weight regardless of its size. Chapter work on calculated fields and custom formulas addresses this directly, and it depends on the aggregate-first rule from this chapter.
Exercise
Using the example table with Region in Rows, you add Units to Values with SUM and read a grand total of 36. You then switch the field to AVERAGE. What are the East and West values and the grand total, and why is the grand total not the mean of the three regional values?
Show answer
Units for East are 4 and 12, so the average is 8. For West the units are 10 and 7, so the average is 8.5. South has only 3. The grand total is 36 / 5 = 7.2, because it is the mean of all five source rows. The mean of the regional values would be (8 + 3 + 8.5) / 3 = 6.5, which differs because groups have different numbers of rows and the pivot does not average the group averages.
Exercise
You want a pivot table of Product in Rows that shows how many different regions bought each product. Which field goes in Values, and which Summarize by function do you choose? What do you expect for Widget and Gadget?
Show answer
Put Region in Values and set Summarize by to COUNTUNIQUE. Widget was sold in West and East, so it shows 2. Gadget was sold in West and South, so it shows 2. Gizmo, sold only in East, shows 1.
Exercise
A Revenue column imported from a CSV shows SUM of Revenue as 0 for every region, but COUNTA gives the right number of records. What is the most likely cause, and how do you fix it?
Show answer
The values are stored as text, not numbers. SUM ignores text, while COUNTA counts any non-empty cell. Convert the column to numbers in the source (for example, remove the leading apostrophes or use Format > Number), then refresh the pivot table.