GETPIVOTDATA function in Excel
Returns data stored in a PivotTable report
=GETPIVOTDATA(data_field, pivot_table, [field1, item1, field2, item2], ...)GETPIVOTDATA syntax and parameters
Six arguments, two required.
- data_fieldstringRequired
The name of the PivotTable field that contains the data that you want to retrieve. This needs to be in quotes.Example: =GETPIVOTDATA("Sales", A3). Here, "Sales" is the Values field that we want to retrieve. Since no other field is specified, GETPIVOTDATA returns the total sales amount.
- pivot_tablerangeRequired
A reference to any cell, range of cells, or named range of cells in a PivotTable. This information is used to determine which PivotTable contains the data that you want to retrieve.Example: =GETPIVOTDATA("Sales", A3). Here, A3 is a reference inside the PivotTable and tells the formula which PivotTable to use.
- field1anyOptional
- item1anyOptional
- field2anyOptional
- item2anyRepeating
GETPIVOTDATA examples
Formulas you'll actually reuse.
West region revenue from a pivot table, no matter where that row moves:
=GETPIVOTDATA("Revenue", $A$3, "Region", "West")Result
184250Narrow it down by two fields — Region and Quarter:
=GETPIVOTDATA("Revenue", $A$3, "Region", "West", "Quarter", "Q3")Result
48900
GETPIVOTDATA in Google Sheets
Same name — your formula ports as-is.
Try GETPIVOTDATA in the playground
Edit the example — nothing to install.
Preloaded with the GETPIVOTDATA formula from Example 1 — change anything and watch it respond.
GETPIVOTDATA errors
What they mean — and the fixes.
#REF!A field or item name doesn't exist in the pivot table, or the anchor cell isn't inside it — names must match the pivot's headers exactly.
Related functions
More ways Excel gets this done.
- ADDRESSReturns a reference as text to a single cell in a worksheetLookupGoogle Sheets
- AREASReturns the number of areas in a referenceLookupNo Google Sheets equivalent
- CHOOSEChooses a value from a list of valuesLookupGoogle Sheets
- CHOOSECOLSReturns the specified columns from an arrayLookupGoogle Sheets
- CHOOSEROWSReturns the specified rows from an arrayLookupGoogle Sheets
- COLUMNReturns the column number of a referenceLookupGoogle Sheets