Pivot Table Issues

How to Use and Compare Excel PivotTable Grand Totals in Formulas and Charts

Camila MilosovichCamila Milosovich Oct 28, 2026 871 views

Question details

The user needs to dynamically reference grand totals from single or multiple PivotTables for use in formulas and charts, ensuring references don't break when tables resize.

How to Use and Compare Excel PivotTable Grand Totals in Formulas and Charts
Product
Excel
Device & OS
not provided
Scenario
Creating charts or comparative formulas using data summaries (grand totals) from various PivotTables that may change size due to data updates or filtering.
Observed behavior
Hard-coded references break when the PivotTable expands or collapses, leading to incorrect calculations or chart data.
Before you start

Ensure your PivotTables are fully refreshed and that the 'Generate GetPivotData' option is enabled in your spreadsheet settings. This will make it much easier to dynamically reference totals without manual typing.

Solution 1Recommended

Use GETPIVOTDATA to dynamically extract grand totals

This is the most robust method to prevent reference errors when a PivotTable resizes or is filtered.

By avoiding hard-coded cell references (like =C25), you protect your formulas from breaking. The GETPIVOTDATA function locks onto the actual data field rather than the cell location.

1
Create a summary area

Choose a blank cell outside your PivotTables to act as the dedicated summary range for your formulas and charts.

2
Enter the formula

Type '=' in the blank cell, and then click directly on the Grand Total cell of your PivotTable. The GETPIVOTDATA formula will automatically generate.

3
Repeat for comparisons

Do the same for other PivotTables in adjacent cells. This allows you to easily write comparison formulas (like variances) between them using standard cell references pointing to your new summary area.

4
Create your chart

Highlight your new summary range, navigate to the Insert tab, and insert a chart. The chart will now dynamically update based on the correct grand totals.

Dynamic Updates: Using GETPIVOTDATA ensures your formulas and charts will always capture the exact grand total value, even if rows or columns are added or removed from the PivotTable.
Advanced PivotTables in WPS Office

Manage and Compare PivotTable Data Easily with WPS Spreadsheet

WPS Spreadsheet provides robust PivotTable functionality, including full support for GETPIVOTDATA, dynamic charts, and advanced data modeling. You can easily summarize and visualize your data without worrying about compatibility issues.

  1. 1. Open your file: Launch WPS Spreadsheet and open the workbook containing your PivotTables.
  2. 2. Start the formula: Select any blank cell outside the PivotTable and type an equals sign (=).
  3. 3. Capture the Grand Total: Click the Grand Total cell inside your PivotTable to automatically insert the GETPIVOTDATA function.
  4. 4. Insert Chart: Highlight your newly referenced summary data cells, go to the Insert tab, and choose your preferred chart type.
Full compatibility with Microsoft Excel PivotTables and .xlsx file formats.Seamlessly generate dynamic charts from summarized data.Built-in formula autocomplete for functions like GETPIVOTDATA and SUMIF.Free, lightweight, and fast performance even with large datasets.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my chart data change incorrectly when I filter the PivotTable?

If your chart is based on hard-coded cell references (like =C25), filtering the PivotTable can shrink the table and move the Grand Total to a different cell (like =C15). Using GETPIVOTDATA solves this by locking onto the data field logic rather than the static cell address.

How do I turn on the Generate GetPivotData feature?

Select any cell inside your PivotTable. Go to the PivotTable Analyze (or Options) tab on the top ribbon, click the 'Options' dropdown on the far left, and check the 'Generate GetPivotData' setting.

Can I compare grand totals from PivotTables on different worksheets?

Yes. You can create a master summary sheet and use the GETPIVOTDATA formula to point to Grand Totals on various different worksheets within the same workbook, then use that summary sheet as the source for your charts.

Why does my GETPIVOTDATA formula return a #REF! error?

This error usually occurs if the data field or item you are referencing in the formula is currently hidden by a filter in the PivotTable, or if the underlying field names in the PivotTable were changed.