Lookup & reference function

GETPIVOTDATA function

Pulls a specific value out of a PivotTable by naming the value field and the items you want, so the result survives pivot layout changes.

Available in All versions of Excel, including Microsoft 365, Excel for the web and Excel for Mac

In every Excel versionWorks in Google Sheets

Syntax

GETPIVOTDATA(data_field, pivot_table, [field1, item1], [field2, item2], ...)
ArgumentWhat it means
data_fieldRequiredThe name of the value field, in quotes - the source column name such as "Revenue" (the displayed name "Sum of Revenue" also works).
pivot_tableRequiredAny cell inside the PivotTable, usually its top-left cell such as $A$1.
field1, item1OptionalPairs of a field name and an item, e.g. "Region", "North". Add up to 126 pairs to narrow down the value. Leave them out to get the grand total.

Returns: The value from the PivotTable that matches the field/item pairs.

How GETPIVOTDATA works

When you click a cell of a PivotTable while writing a formula, Excel often types a GETPIVOTDATA formula for you instead of a plain reference like B3. That is deliberate: a PivotTable moves and resizes every time it is refreshed, filtered or rearranged, so =B3 might point at a different region tomorrow. GETPIVOTDATA instead describes the number in words - "the Revenue for Region North" - and finds it wherever it currently sits.

You give it the value field, any cell in the pivot, and then as many field/item pairs as you need. With no pairs it returns the grand total. If the item you ask for is not visible in the pivot (filtered out, collapsed, or simply not in the data) the result is #REF!, so it only reports what the PivotTable currently shows. Dates and numbers used as items should be given as real values, for example DATE(2026,3,1), rather than text.

If you prefer plain references, switch the automatic behaviour off under PivotTable Analyze > Options > Generate GetPivotData. Many report builders, however, deliberately use GETPIVOTDATA with cell references for the items to build tidy dashboards from a hidden pivot.

Examples

1Revenue for one region

D2fx=GETPIVOTDATA("Revenue", $A$1, "Region", "North")
ABCD
1Row LabelsSum of Revenue
2East21604638
3North4638
4South5990
5Grand Total12788

Result: 4638

The pivot sums Revenue by Region. GETPIVOTDATA finds the North row and returns its total, even if the pivot is later sorted so North moves.

2Grand total

D2fx=GETPIVOTDATA("Revenue", $A$1)
ABCD
1Row LabelsSum of Revenue
2East216012788
3North4638
4South5990
5Grand Total12788

Result: 12788

With no field/item pairs the function returns the pivot's grand total.

3Two fields: region and product

G2fx=GETPIVOTDATA("Revenue", $A$1, "Region", "South", "Product", "Laptop")
ABCDEFG
1Sum of RevenueColumn Labels
2Row LabelsLaptopMonitorMouseGrand Total4500
3East18003602160
4North36008941444638
5South450014905990
6Grand Total9900238450412788

Result: 4500

This pivot has Region in rows and Product in columns. The two pairs pin down the South / Laptop intersection.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 15 KB

Common errors and how to fix them

ErrorWhy it happensFix
#REF!A field or item name is misspelled, the item is filtered out or collapsed, or pivot_table is not inside a PivotTable.Check names against the pivot and make sure the item is visible.
#REF!The value is part of a calculated item or the pivot was deleted.Refresh or rebuild the PivotTable and re-create the formula.

Tips

  • Replace the typed items with cell references ("Region", $F2) to build a report grid you can copy down and across.
  • Turn off automatic GETPIVOTDATA in PivotTable Analyze > Options if you want ordinary references when clicking pivot cells.
  • For Data Model / Power Pivot reports, the CUBE functions such as CUBEVALUE offer a similar approach without a pivot.

Google Sheets

GETPIVOTDATA also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.

GETPIVOTDATA in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
CzechZÍSKATKONTDATA
DutchDRAAITABEL.OPHALEN
FinnishNOUDA.PIVOT.TIEDOT
FrenchLIREDONNEESTABCROISDYNAMIQUE
GermanPIVOTDATENZUORDNEN
HungarianKIMUTATÁSADATOT.VESZ
ItalianINFO.DATI.TAB.PIVOT
Norwegian (Bokmål)HENTPIVOTDATA
PolishWEŹDANETABELI
Portuguese (Brazil)INFODADOSTABELADINÂMICA
Portuguese (Portugal)OBTERDADOSDIN
RussianПОЛУЧИТЬ.ДАННЫЕ.СВОДНОЙ.ТАБЛИЦЫ
SpanishIMPORTARDATOSDINAMICOS
SwedishHÄMTA.PIVOTDATA
TurkishÖZETVERİAL