Sub topic 16
Troubleshooting common pivot table problems
This chapter assumes you can create a pivot table, place fields in Rows, Columns, Values and Filters, and choose a Summarize by function. It also assumes you know what a source range is. Most pivot problems come from three places: the source data, the source range, and the Summarize by setting. The sections below follow that order, then cover the pivot editor's own settings.
A method for diagnosing problems
Work from the data toward the display. Check the cheapest explanation first.
- Look at the source data. Are there blanks, text-formatted numbers, or inconsistent labels?
- Look at the source range in the pivot table editor. Does it cover all the rows and columns?
- Look at the Summarize by setting on each value field.
- Look at filters, Show as, and grouping.
- Cross-check one number with a formula that does not depend on the pivot table.
The last step is the quickest way to tell whether the pivot table or your expectation is wrong.
Missing rows and missing data
The source range is stale
If you built the pivot table from a fixed range such as Sales!A1:E100 and later added rows 101 to 200, the new rows are not included. The pivot table does not guess that the data grew.
Fix it by opening the pivot table editor and editing the Data range. Two options work well:
- Use an open-ended range such as
Sales!A1:E. New rows below the data are picked up automatically. - Use the full columns, for example
Sales!A:E, which also includes the header row at the top.
Avoid blank rows inside the data. An open-ended range handles trailing blanks, but a blank row in the middle can still produce a row labeled as blank in the pivot table.
A filter hides the rows
A pivot filter can exclude values without any visible warning in the table itself. If a region or product is missing, open the editor and check the Filters section. A filter set to "Showing all items" is inactive. Any other state hides something.
Also check whether a slicer is attached to the pivot table. A slicer applies its own filter on top of the editor's filters, so a missing row can come from either.
Rows with blank key fields
Pivot tables show records with a blank in a Rows field as a row labeled with an empty or "(blank)" value, or they may drop it depending on the Show totals and Show blank settings. If your totals look too small, look for blanks in the field you group by. A QUERY with where B is not null also leaves out those rows, so it can differ from a pivot table for the same reason.
Wrong counts and wrong totals
SUM versus COUNT
When you drop a field into Values, Sheets chooses SUM for numeric fields and COUNTA for text fields. A column of numbers stored as text is counted rather than summed. If a revenue total looks like a small whole number, the field is probably being counted.
Change it in the editor: open the value field and set Summarize by to SUM.
Numbers stored as text
Numbers can arrive as text from a CSV import, a copy from a web page, or a leading apostrophe. Signs of the problem:
- The values align to the left of their cells.
=ISNUMBER(E2)returns FALSE.- The pivot table counts the field instead of summing it.
To convert a column, put this in a spare column and copy the results back as values:
=ARRAYFORMULA(IF(E2:E="", "", VALUE(E2:E)))Then use Edit, Paste special, Values only over the original column. Check again with ISNUMBER.
COUNT, COUNTA and COUNTUNIQUE
The count functions answer different questions. Pick the one that matches your question.
| Summarize by | Counts | Typical use |
|---|---|---|
| COUNT | Numeric cells only | How many numeric entries |
| COUNTA | Non-empty cells | How many records with a value |
| COUNTUNIQUE | Distinct values | How many different customers |
If you want the number of records per group, count a column that is never empty, such as an order ID. Counting a column with blanks undercounts.
Duplicate records
If a total is too high, the source may contain duplicate rows, for example from importing the same file twice. The pivot table adds them faithfully. Use Data, Data cleanup, Remove duplicates on a copy of the source, or compare a COUNTUNIQUE of the ID column to the row count.
Inconsistent labels
"West", "west", and "West " (with a trailing space) can show up as separate rows. Sheets treats case differences as the same item in most grouping, but trailing spaces and spelling differences create separate rows. Clean the source with TRIM, or use Data, Data cleanup, Trim whitespace.
Grand totals and subtotals that look wrong
Totals in a pivot table apply the Summarize by function to the underlying records. They do not add up the displayed cells. For SUM this gives the same answer. For AVERAGE it does not: the grand total is the average of all records, not the average of the row averages. This is correct behavior, but it surprises people who check it by hand.
The same applies to Show as percentages. A "% of column" grand total is 100% by definition, and a filter changes the base of the percentage because the filtered-out rows are no longer in the total.
Totals can also be turned off. In the editor, under Rows and Columns, the Show totals checkbox controls them. If the totals are missing, check this box first.
Date problems
Dates that will not group
The date grouping options (Year-Month, Quarter, and so on) appear only when Sheets recognizes the field as a date. Text that looks like a date, for example 2026-11-27 pasted as text, does not group. Use =ISNUMBER(A2) to test the cell: true dates return TRUE.
To convert, use DATEVALUE or reformat the column with Format, Number, Date. If a locale mismatch causes day and month to swap, set the spreadsheet locale in File, Settings first.
Grouping merges years
Grouping by Month alone combines every January across all years into one row. If you have more than one year of data, choose Year-Month so each period stays separate.
Errors inside and around the pivot table
The pivot table cannot expand
A pivot table writes its output into a block of cells below and to the right of its anchor. If something already occupies that space, Sheets shows an error saying the result would overwrite data. Clear the cells in the way or move the pivot table to a new sheet. This is why new sheets are a safe default for pivot tables.
GETPIVOTDATA returns #REF!
GETPIVOTDATA looks up an item by name in the pivot table. It returns #REF! when the item is not currently shown. Common causes are a filter that hides the item, a changed field name, or a region value that no longer exists.
=GETPIVOTDATA("Revenue", Pivot!A1, "Region", "West")For this formula to work, the value field must be named Revenue in the pivot table and "West" must appear as a row item. If you renamed the value field to something like "Total revenue", the first argument has to match the new name. Wrap the formula in IFERROR when a missing item is a normal state.
Cross-checking with SUMIFS
When a number looks wrong, calculate it a second way from the source:
=SUMIFS(Sales!E:E, Sales!B:B, "West")If the result matches the pivot table, the pivot table is correct, and the issue is in your expectation or in the data. If the numbers differ, compare the pivot's source range with Sales!E:E. A filter, a stale range, or text-formatted numbers usually explains the gap. Note that SUMIFS ignores text-formatted numbers just as SUM does, so a match here does not prove the data is clean.
For a whole-table check, a QUERY can recreate the summary:
=QUERY(Sales!A1:E, "select B, sum(E) where B is not null group by B label sum(E) 'Total revenue'", 1)Compare it row by row with the pivot table. A row present in the pivot but not in the query, or the reverse, points to blank handling or filters.
Calculated fields that misbehave
A calculated field applies its formula to the summed values of the fields it references, not row by row. A formula such as =Revenue/Units gives total revenue divided by total units for each group. This is usually what you want for a price per unit, but it is not the average of each record's ratio.
Other things to check:
- Field names with spaces must be written in single quotes, for example
='Unit price'*Units. - Calculated fields always use SUM on the fields inside them. You cannot change that inside the formula.
- A calculated field cannot reference cells outside the pivot table.
Quick reference
| Symptom | Likely cause | Fix |
|---|---|---|
| New rows missing | Fixed source range | Use an open-ended range such as `A1:E` |
| A value shows a count, not a sum | Numbers stored as text | Convert with `VALUE`, set SUM |
| Two rows for the same item | Trailing spaces or spelling | `TRIM` the source |
| Dates will not group | Dates stored as text | Convert to real dates |
| Months from different years merge | Grouping by Month only | Use Year-Month |
| Pivot shows an overwrite error | Cells in the way | Clear them or use a new sheet |
| `GETPIVOTDATA` gives `#REF!` | Item hidden or renamed | Check filters and field names |
| Average total looks wrong | Total is over all records | Expected behavior |
Exercise
A pivot table of revenue by region shows West = 14 when you expect a dollar total in the thousands. Name two checks that would find the cause, and say what you would change.
Show answer
Check the Summarize by setting on the Revenue value field, because 14 looks like a count of records. Also check whether the Revenue column holds numbers stored as text, for example with =ISNUMBER(E2) or by looking for left-aligned values. Convert the column to real numbers with VALUE and paste it back as values, then set Summarize by to SUM.
Exercise
You added 40 new rows to the bottom of a sheet, but the pivot table total did not change. The pivot's data range is Sales!A1:E200. What is the cause, and how do you prevent it from happening again?
Show answer
The data range is fixed at row 200, so the new rows fall outside it. Edit the data range in the pivot table editor to an open-ended range such as Sales!A1:E so that rows added later are included automatically.
Exercise
GETPIVOTDATA("Revenue", Pivot!A1, "Region", "West") returns #REF! even though West exists in the source data. Give two possible reasons.
Show answer
A filter or slicer may be hiding West in the pivot table, so the item is not displayed. Or the value field may have been renamed, for example to "Total revenue", so the first argument "Revenue" no longer matches any field name in the pivot table.