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], ...)| Argument | What it means | |
|---|---|---|
data_field | Required | The name of the value field, in quotes - the source column name such as "Revenue" (the displayed name "Sum of Revenue" also works). |
pivot_table | Required | Any cell inside the PivotTable, usually its top-left cell such as $A$1. |
field1, item1 | Optional | Pairs 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
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Row Labels | Sum of Revenue | ||
| 2 | East | 2160 | 4638 | |
| 3 | North | 4638 | ||
| 4 | South | 5990 | ||
| 5 | Grand Total | 12788 |
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
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Row Labels | Sum of Revenue | ||
| 2 | East | 2160 | 12788 | |
| 3 | North | 4638 | ||
| 4 | South | 5990 | ||
| 5 | Grand Total | 12788 |
Result: 12788
With no field/item pairs the function returns the pivot's grand total.
3Two fields: region and product
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Sum of Revenue | Column Labels | |||||
| 2 | Row Labels | Laptop | Monitor | Mouse | Grand Total | 4500 | |
| 3 | East | 1800 | 360 | 2160 | |||
| 4 | North | 3600 | 894 | 144 | 4638 | ||
| 5 | South | 4500 | 1490 | 5990 | |||
| 6 | Grand Total | 9900 | 2384 | 504 | 12788 |
Result: 4500
This pivot has Region in rows and Product in columns. The two pairs pin down the South / Laptop intersection.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#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.
| Language | Function name |
|---|---|
| Czech | ZÍSKATKONTDATA |
| Dutch | DRAAITABEL.OPHALEN |
| Finnish | NOUDA.PIVOT.TIEDOT |
| French | LIREDONNEESTABCROISDYNAMIQUE |
| German | PIVOTDATENZUORDNEN |
| Hungarian | KIMUTATÁSADATOT.VESZ |
| Italian | INFO.DATI.TAB.PIVOT |
| Norwegian (Bokmål) | HENTPIVOTDATA |
| Polish | WEŹDANETABELI |
| Portuguese (Brazil) | INFODADOSTABELADINÂMICA |
| Portuguese (Portugal) | OBTERDADOSDIN |
| Russian | ПОЛУЧИТЬ.ДАННЫЕ.СВОДНОЙ.ТАБЛИЦЫ |
| Spanish | IMPORTARDATOSDINAMICOS |
| Swedish | HÄMTA.PIVOTDATA |
| Turkish | ÖZETVERİAL |