Skip to content
Excel

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.

  1. West region revenue from a pivot table, no matter where that row moves:

    =GETPIVOTDATA("Revenue", $A$3, "Region", "West")

    Result184250

  2. Narrow it down by two fields — Region and Quarter:

    =GETPIVOTDATA("Revenue", $A$3, "Region", "West", "Quarter", "Q3")

    Result48900

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.

Loading the editor…

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.