Sub topic 3
Pivot Tables in Google Sheets: Showing Values as Percentages
Showing values as percentages
Use Show as in the Values section to turn totals into shares. Choose "% of row total", "% of column total", or "% of grand total". Each option divides by a different base, so pick the one that answers your question.
Grouping dates by month, quarter or year
Add a date field to Rows, then open its menu and choose a date group: year, quarter, or month. Grouping combines individual dates into periods, so totals match the question you ask.
Keeping the pivot table current as data grows
A pivot table reads a fixed source range. When you add rows below the data, widen the range in the pivot editor. Alternatively, base the source on a named range or a Google Sheets table that expands automatically.
Adding calculated fields
In Values, choose Add calculated field and enter a formula that uses field names, such as =Revenue-Cost. Google Sheets applies the formula to the summed fields in each group.
Charts and slicers for pivot tables
Select a cell in the pivot table and choose Insert > Chart to chart its results. Use Data > Add a slicer to filter the source data from a sidebar. The chart updates when the slicer changes.
Pulling pivot results into formulas with GETPIVOTDATA
GETPIVOTDATA finds a pivot value by its field and item names, so the formula still works if the table moves:
=GETPIVOTDATA("Revenue", Pivot!A1, "Region", "West")Checking results with SUMIFS and QUERY
Cross-check the pivot total against the source data:
=SUMIFS(Sales!E:E, Sales!B:B, "West")To build a summary by formula instead, use QUERY:
=QUERY(Sales!A1:E, "select B, sum(E) where B is not null group by B label sum(E) 'Total revenue'", 1)> Note: the QUERY example above uses a block quote marker in your display only; it is not part of the chapter.
Troubleshooting common pivot table problems
- Missing rows: the source range is too short, or a header cell is blank.
- Wrong counts: numbers stored as text are counted, not summed. Check the Summarize by setting.
- Stale results: widen the source range after adding data.
- #REF! in GETPIVOTDATA: the field or item name does not match the pivot exactly.
Exercise
In a pivot table of revenue by region, which Show as option gives each region's share of all revenue?
Show answer
% of grand total.