GETPIVOTDATA function in Google Sheets
Extracts an aggregated value from a pivot table that corresponds to the specified row and column headings.
=GETPIVOTDATA(value_name, any_pivot_table_cell, [original_column, ...], [pivot_item, ...])GETPIVOTDATA syntax and parameters
Four arguments, two required.
- value_namestringRequired
The name of the value in the pivot table for which you want to get data. value_name must be enclosed in quotation marks or be a reference to any cell containing the appropriate text. If there is more than one value field, you have to use the exact name that appears in the pivot table (For example, “SUM of Sales”).
- any_pivot_table_cellrangeRequired
Any reference to a cell in the desired pivot table (top corner recommended).
- original_columnstringRepeating
[ OPTIONAL ] - The name of the column in the source data set (not the pivot table).
- pivot_itemstringRepeating
[ OPTIONAL ] - The name of the row or column shown in the pivot table corresponding to original_column that you want to retrieve.
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 Excel
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 Google Sheets gets this done.
- ADDRESSReturns a cell reference as a string.LookupExcel
- CHOOSEReturns an element from a list of choices based on index.LookupExcel
- COLUMNReturns the column number of a specified cell, with `A=1`.LookupExcel
- COLUMNSReturns the number of columns in a specified array or range.LookupExcel
- FORMULATEXTReturns the formula as a string. .LookupExcel
- HLOOKUPHorizontal lookup. Searches across the first row of a range for a key and returns the value of a specified cell in the column found.LookupExcel