Sub topic 2
Preparing Your Source Data
Before creating a pivot table, prepare the source range carefully. This chapter assumes you can select ranges, use Google Sheets menus, enter simple formulas, and recognize basic aggregations such as sum, count, and average.
A pivot table summarizes records. Each row should represent one record, and each column should represent one field. For example, a sales table might contain one row per order.
| Order ID | Date | Region | Product | Revenue |
|---|---|---|---|---|
| 1001 | 2026-01-05 | West | Keyboard | 125 |
| 1002 | 2026-01-06 | East | Monitor | 300 |
| 1003 | 2026-01-06 | West | Mouse | 45 |
Use a simple rectangular table
A reliable source range has these properties:
- The first row contains one unique header for each column.
- Every row below the header contains one record.
- Every column contains one kind of field, such as dates, regions, products, or revenue.
- There are no completely blank rows or columns inside the table.
- There are no merged cells.
- Values that should be numbers are stored as numbers, not as text.
- Dates are real date values, not text that only looks like a date.
- The table does not contain manual subtotals or grand totals.
Headers become field names in the pivot table editor. A blank header can make a field confusing or unavailable. Duplicate headers can also make it difficult to identify the correct field.
Check data types and missing values
A column should use consistent values. If most Revenue cells contain numbers but one cell contains $125 as text, the pivot table may count that value instead of adding it. Select the column and check that its values have the expected number or date format.
Missing values require a decision. A blank Region means the record has no region, while the label Unknown means someone deliberately classified it that way. Use a consistent choice so that the pivot table groups these records predictably.
For dates, check several cells with Format > Number > Date. Dates that are stored as text may not group correctly by month, quarter, or year.
Plan for new records
When creating the pivot table, choose a source range that can include future records. A fixed range such as A1:E100 will not include a record added on row 101. You can select a larger planned range, such as A1:E1000, but empty rows inside that range should remain empty rather than containing partial data.
An open-ended range, such as A:E, can include future rows, but it may also include unrelated content placed in those columns. Keep the data on its own sheet when possible.
Final preparation checklist
- Remove merged cells and manual totals.
- Give every column a clear header.
- Confirm that each row is one complete record.
- Correct numbers and dates stored as text.
- Decide how to label missing categories.
- Keep the source range free of unrelated content.
- Note where future records will be added.
Exercise
A sales table has a blank header in column E, a subtotal row at the bottom, and dates entered as text. What should you fix before creating the pivot table?
Show answer
Add a clear header to column E, remove the subtotal row, and convert the date values to real dates. Then confirm that each remaining row is one sales record.