Sub topic 1
Start with clean source data
Prerequisites
This chapter assumes you can navigate Google Sheets, enter cell formulas such as =SUM(A1:A10), and work with data in a table that has one header row and one record per row. You should know what SUM, COUNT and AVERAGE do.
A pivot table is a summary built from a source range. It groups and totals whatever cells it reads. If the source has numbers stored as text, dates stored as text, or blank cells in key columns, the pivot table still builds, but its totals can be wrong or incomplete.
Before you build a pivot table, check these points:
- Every column has a header in row 1, and no header is blank.
- Numbers are stored as numbers. Text numbers are usually left-aligned.
- Dates are real dates. A date stored as text cannot be grouped by month or year.
- Each row holds one record, with no subtotal rows mixed in.
Recap of the pivot table editor
To create a pivot table, select any cell in your data, choose Insert, then Pivot table. The editor places fields into four areas:
- Rows: categories listed down the left side.
- Columns: categories listed across the top.
- Values: the numbers being summarized.
- Filters: fields that limit which rows are included.
How values are summarized
Each value field has a summarize function. Common choices are SUM, COUNT, AVERAGE, MIN and MAX. Pick the function that answers your question. Total revenue needs SUM. The number of sales needs COUNT.
Group items by hand
Manual grouping combines several row or column items into one named group, such as joining "East" and "South" into "Eastern Sales."
- Click the first item, then hold Ctrl (or Cmd on a Mac) and click the others.
- Right-click one selected item and choose the option to create a group.
- Rename the new group so its label is clear.
Exercise
Why does a date stored as text break date grouping?
Show answer
Text dates sort alphabetically and are not recognized as dates, so the pivot table cannot group them by month, quarter or year. Convert them to real dates before you build the pivot table.