Ravindra BagaleCourses & study guides

7. PivotTables and PivotCharts

7.10 GETPIVOTDATA

When you type = and click a value inside a PivotTable, Excel writes a GETPIVOTDATA formula:

=GETPIVOTDATA("Amount", $A$3, "City", "Pune", "Platform", "Blinkit")    → 434

It keeps returning Pune–Blinkit even if the pivot is rearranged or sorted – great for fixed-format reports and KPI cards. Replace the text with cell references to make it dynamic: =GETPIVOTDATA("Amount",$A$3,"City",$H$1).

Steps in Excel

  1. In a cell outside the pivot type = and click the Pune grand-total cell › Enter.
  2. Replace "Pune" with a cell that has a City drop-down.
  3. To get normal references like =B6 instead: PivotTable Analyze › PivotTable › Options ▾ › untick Generate GetPivotData.

Ravindra Bagale's Tip

When they see GETPIVOTDATA, many students panic and switch it off, and then after sorting the pivot, =B6 shows the wrong city. For KPI cards and fixed reports, GETPIVOTDATA is the safe choice. Just remember – for an item that isn't visible in the pivot (because of a filter), you get #REF!; handle it with IFERROR.

Practice task

Create three KPI cells with GETPIVOTDATA: total sales, Pune sales, and sales for the city selected in a drop-down. Sort the pivot and confirm the KPIs don't change.