GETPIVOTDATA
Pull a single summarized value out of a pivot table with Excel's GETPIVOTDATA function.
Syntax
=GETPIVOTDATA(DataField, PivotTable, Field1, Item1, [Field2], [Item2], ..., [FieldN, [ItemN]])
Returns: Number Arguments
| Argument | Required | Description |
|---|---|---|
| DataField | Yes | The specific data field or value to retrieve from the pivot table. |
| PivotTable | Yes | A reference to any cell in the pivot table where the data is stored. |
| Field1 | Yes | The name of the first field in the pivot table by which the data is summarized. |
| Item1 | Yes | The specific value or item within the first field to filter the data. |
| Field2 | No | Additional field(s) for further filtering or summarizing the data. |
| Item2 | No | The specific value or item within the respective additional field(s) for data refinement. |
| FieldN | No | Final field for detailed data selection. |
| ItemN | No | The specific value within the last field for precise data extraction. |
About
Reach for it when you build dashboards or summary reports on top of a pivot table and need specific numbers in fixed spots, like a KPI tile or a printed header. Excel often writes these formulas for you: type "=" and click a value inside the pivot table, and it fills in the GETPIVOTDATA syntax automatically. You can switch that behavior on or off under PivotTable Analyze > Options > Generate GetPivotData.
If your data lives in a normal range or table rather than a pivot table, conditional functions like SUMIFS or lookups like VLOOKUP and INDEX with MATCH are usually a better fit.
Examples
Regional sales total
=GETPIVOTDATA("Sum of Sales", A3, "Region", "East") Sales for one product in one region
=GETPIVOTDATA("Sum of Sales", $A$3, "Region", "East", "Category", "Electronics") Dynamic dashboard KPI
=GETPIVOTDATA("Sum of Revenue", $A$3, "Month", DATE(2026,1,1), "Department", $B$1) Grand total headline number
=GETPIVOTDATA("Sum of Sales", A3) Watch out for
#REF! when the value isn't visible
GETPIVOTDATA returns a #REF! error when the field or item isn't currently shown in the pivot table, for example when a report filter hides it or a name is mistyped.
→ Check that the field and item are visible in the pivot table and that the names match exactly. Wrap the formula in IFERROR if you want a friendlier fallback.
Names have to match the pivot table
The data field is usually "Sum of Sales", not just "Sales", and item text is sensitive to spelling and spacing. A small mismatch breaks the formula.
→ Let Excel write the first formula for you (type "=" and click the value), then edit the field and item text from there.
Excel keeps writing GETPIVOTDATA
When you click a pivot table cell while building another formula, Excel inserts GETPIVOTDATA instead of a plain reference like B5.
→ Switch it off under PivotTable Analyze > Options > Generate GetPivotData, then click cells normally.