Sub topic 1
Start with Clean Source Data
Prerequisites
Assume that you can navigate Google Sheets, enter basic formulas, and use SUM, COUNT, and AVERAGE. You should also know that a pivot table summarizes source records instead of changing them.
A pivot table is only as reliable as its source range. Grouping and calculated fields depend on the values and headers in that range. Before creating the pivot table, make the source data rectangular, consistent, and easy to inspect.
Use One Header Row
Put one header row at the top of the table. Each header should identify one field, such as Date, Region, Product, Units, Revenue, or Cost.
Do not use:
- Blank header cells.
- Duplicate headers.
- Merged cells.
- Decorative title rows above the headers.
- Subtotal or total rows inside the source range.
- Notes mixed into the records.
Each row below the header should describe one record. Each column should contain one kind of field. For example, Revenue should contain revenue amounts, not comments such as “pending.”
A small source table might look like this:
| 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 | 420 |
This structure gives the pivot editor clear fields to place in Rows, Columns, Values, and Filters.
Keep Data Types Consistent
A data type is the kind of value stored in a cell. Dates, numbers, and text behave differently during grouping and calculation.
Dates must be real date values, not text that only looks like a date. A date displayed as 2026-01-05 may still be text if it was imported or entered with an unusual format. Select a date cell and check the formula bar. You can also test it in another cell with =ISNUMBER(A2). A real date usually returns TRUE, because Sheets stores dates as numbers.
Numeric columns should contain numbers without currency symbols or explanatory text typed into the cell. Apply currency or number formatting instead of entering values such as $250 as text. Check a value with =ISNUMBER(E2).
Use one spelling and capitalization for each category. West, west, and WEST may be treated as separate row items. Remove accidental spaces with TRIM when necessary. Also decide how to represent missing values. A blank, a zero, and the text N/A have different meanings.
Extend the Source Range Safely
When you create a pivot table, select the header row and all current records. If new records will be added later, use a sufficiently broad range or convert the data into a table-like working area that you maintain consistently. Avoid selecting unrelated columns or entire worksheet sections containing notes.
Before building the pivot, scan for:
- Blank rows that split the records.
- Blank cells in important fields.
- Dates stored as text.
- Numbers stored as text.
- Spelling variations.
- Duplicate records.
- Existing subtotals.
Blank cells can produce a blank group in the pivot table. A duplicate record can inflate a sum without producing an obvious error. A text number may be counted but excluded from a numeric sum.
Check the Data Flow
The source range feeds the pivot table. The pivot then groups records and summarizes fields. A clean source makes each later result easier to explain and verify.
A useful final check is to calculate a simple total directly from the source, such as total revenue. After creating the pivot table, compare its grand total with the direct total. If they differ, inspect the source range, data types, filters, and duplicate records before adding more pivot features.
Exercise
The Date column displays dates, but grouping by month creates unexpected categories. What should you check first?
Show answer
Check whether the cells contain real date values rather than text. Test a date with =ISNUMBER(A2), then convert the text values to dates if the result is FALSE.