Last updated: December 6, 2009 2:39 AM
Search Contextures Sites ![]()
Excel Pivot Table Tutorial -- GetPivotData
- Generate GetPivotData
- Watch the Excel Pivot Table Tutorial Video
- GetPivotData Formula
- Using Cell References in GetPivotData
Download the zipped sample file for this Excel pivot table tutorial
To add a Generate GetPivotData button:
On the PivotTable toolbar, click the Generate GetPivotData button to toggle this feature on and off.
Watch the Excel Pivot Table Tutorial Video
View the steps to customize the toolbar, in a short pivot table tutorial video clip.
GetPivotData Formula
To extract data from an Excel Pivot Table, you can use the GetPivotData function. The function arguments depend on the version of Excel that you're using, so check Excel's on-line help for examples.
The example at the right is for Excel 2002, and returns the number of Units sold in Ontario. In Excel 2002, if you have the Generate GetPivotData feature turned on, this formula will be created automatically, when you reference a cell in the Excel Pivot Table.
In Excel 2000 or Excel 97, you have to create the GetPivotData formula manually, by typing an equal sign, the function name, and the required arguments, just as you would for any other function.
This example shows the function arguments required for Excel 2000 or Excel 97, to return the number of Units sold in Ontario.
This example shows the function arguments required for Excel 2000 or Excel 97, to return the total number of Units sold.
Using Cell References For the Data Field in GetPivotData
Cell references work well for the pivot fields and pivot items, but can cause problems if you try to refer to a data field.
In this example, cell B10 contains the word "Units", and you'd like to refer to that cell, instead of having "Sum of Units" in the GetPivotData formula.
The first argument, data_field, can be changed to a reference to cell B10:
=GETPIVOTDATA(B10,$B$3,"Region",A11)
However, when you change "Sum of Units" to B10, the formula returns an error. Add an Empty String
To fix this problem, you can concatenate an empty string ( "" ) at the end of the cell reference:
=GETPIVOTDATA(B10 & "" ,$B$3,"Region",A11)
With this simple change to the formula, it returns the correct result.
Download the zipped sample file for this Excel pivot table tutorial
Excel Pivot Table Tutorial List
![]()
![]()
Contextures Inc., Copyright © 2009.
All rights reserved.