[]
        
(Showing Draft Content)

GETPIVOTDATA

This function returns visible data from a Pivot Table. It queries the pivot table and gets the specific data based on the pivot table structure, instead of cell references. The main advantage of using this function is that it ensures that the correct data is returned, even if the pivot table layout is changed.

Syntax

GETPIVOTDATA(data_field, pivot_table, [field1, item1, field2, item2], ...)

Arguments

This function has the following arguments:

Arguments

Descriptions

data_field

[Required] The name of the PivotTable field that contains the data you want to retrieve. This needs to be in double-quotes.

pivot_table

[Required] 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.

field1, item1, field2, item2, ...

[Optional] Up to 126 pairs of field names and item names that describe the data that you want to retrieve. The pairs can be in any order.

Remarks

The following points hold true while working with the GETPIVOTDATA function:

  • #REF! error value occurs in the following cases:

    • If the given pivot_table reference is not related to the pivot table.

    • If an invalid field for the data_field, [field], or [item] arguments is provided.

    • If the arguments do not describe a visible field, or if they include a report filter in which the filtered data is not displayed.

  • When there is a sigma value, the data_field will contain calc type, otherwise, it will use the field name only.

Examples

GETPIVOTDATA(""Amount"",Sheet1!$A$1,""Category"",""Mobile"",""Country"",""Australia"")