How to Use GETPIVOTDATA in Excel (4 Useful Examples)

data_field: The name of the PivotTable field containing the data you want to return. This name must be enclosed in quotes.

pivot_table: The specific cell range containing the Pivot Table.

field1, item1: The specific field and element names that you want to retrieve from the dataset, up to a maximum of 126 pairs. Non-numeric values must be enclosed in quotes.

Examples

To describe the examples, we will create a pivot table first.

STEPS

How to Use GETPIVOTDATA in Excel

Example 1 – Use Excel Cell Reference with GETPIVOTDATA

We can use the GETPIVOTDATA function to extract a cell reference and return the required output.

STEPS

Use Excel Cell Reference to Apply GETPIVOTDATA

=GETPIVOTDATA("Sum of Sales",$B$4,"Product","Color Paper")

Example 2 – GETPIVOTDATA in Cell References with a Value Field

If the pivot table has a value field, an additional Empty String must be concatenated onto the data_field parameter.

STEPS

=GETPIVOTDATA(B12&"",$B$4,"Product","Color Paper")

Apply <a href=GETPIVOTDATA in Cell References for Value Field" width="459" height="425" />

The reference cell B12 is associated with Empty String ( “” ) to concatenate the cell reference with cell B4.

Example 3 – Insert Dates using GETPIVOTDATA

Here are four methods:

Method 3.1 – Match Date Format

To demonstrate, we will find the total amount of sales on 14/08/22.

similarDate is an important factor in running the function properly.

STEPS

=GETPIVOTDATA("Sales",$B$4,"Date","14/08/22")

Insert Dates for GETPIVOTDATA Function in Excel

Method 3.2 – Apply DATEVALUE Function

Instead of typing manually, the DATEVALUE function can be used to filter or sort any dates in the pivot table if they are in text format.

To find the value of Product Quantity on 21/08/22:

STEPS

=GETPIVOTDATA("Quantity",$B$4,"Date",DATEVALUE("14/08/22"))

Insert Dates for GETPIVOTDATA Function in Excel

Method 3.3 – Insert DATE Function

The DATE function will be used to return the sequential serial number that represents the date in cell B13.

STEPS

=GETPIVOTDATA("Quantity",$B$4,"Date",DATE(2022,1,8))

Insert Dates for GETPIVOTDATA Function in Excel

Method 3.4 – Use the TEXT Function

The TEXT function will be used to format the numbers given in the formula into date format, so that it runs correctly

STEPS

=GETPIVOTDATA("Quantity",$B$4,"Date",TEXT(B13,”dd/mm/yy”))

Insert Dates for GETPIVOTDATA Function in Excel

Example 4 – Dynamic Use of GETPIVOTDATA

Using the following procedure, output for any type of Product, rather than for a specific selected field, can be returned.

STEPS

Dynamic Use of GETPIVOTDATA Function

=B9

How to Turn Off Auto Generation of GETPIVOTDATA in Excel

STEPS

How to Turn Off Auto Generation of GETPIVOTDATA in Excel

Advantages

Disadvantages

Download Practice Workbook

Application of GETPIVOTDATA.xlsx

How to Use GETPIVOTDATA in Excel: Knowledge Hub