Search Contextures Sites

 

Excel -- Pivot Tables -- GetPivotData

  1. Generate GetPivotData
  2. GetPivotData Formula
  3. Using Cell References in GetPivotData

Download the zipped sample file

 

Generate GetPivotData

In Excel 2002, and later versions, when you type an equal sign, then click on a cell in a pivot table, you may see a GETPIVOTDATA formula, instead of a cell reference.

If you prefer to use a cell reference, you can:

  • type the reference, e.g. =$B$5

or

  • add the Generate GetPivotData button to a toolbar, to turn this feature off.

 

To add a Generate GetPivotData button:

 

  1. On the PivotTable toolbar, click the Toolbar Options button
  2. Click the Add or Remove Buttons command
  3. Click PivotTable, to open the submenu
  4. Near the end of the commands list, click on Generate GetPivotData to add a check mark.
  5. Click on the worksheet, to close the menu.

On the PivotTable toolbar, click the Generate GetPivotData button to toggle this feature on and off.

Watch the Video

View the steps to customize the toolbar, in a short video clip.

GetPivotData Formula

To extract data from a PivotTable, 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 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 in GetPivotData

Excel 2002 and Later

Instead of typing item or field names in the GetPivotData arguments, you can refer to worksheet cells. In this example for Excel 2002, cell A10 contains a region name, and the formula refers to that cell.

The formula will return the sum of Units for the Ontario Region.

 

 

Excel 2000

In this example for Excel 2000, cell A10 contains one of the arguments, and the formula refers to that cell. A space is included at the end of "Units ". If this is omitted, the formula will return an #N/A error.

In the next example, both arguments come from cell references, and a space character is concatenated in the middle, using the & operator.

 

Using Cell References For the Data Field in GetPivotData

Cell references work well for the pivot fields and pviot 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.


Pivot Tables -- Introduction 
Pivot Tables -- Create a Pivot Table in Excel 2007 
Pivot Tables -- Data Field Layout
Pivot Tables -- Show and Hide Items
Pivot Tables -- Clear Old Items
Pivot Tables -- Field Settings
Pivot Tables -- GetPivotData
Pivot Tables -- Grouping Data
Pivot Tables -- Multiple Consolidation Ranges
Pivot Tables -- Printing   
Pivot Tables -- Custom Calculations 
Pivot Tables -- Pivot Cache     
Pivot Tables -- Protection  

Pivot Tables -- Grand Totals
Pivot Tables -- Running Totals
  
Pivot Tables -- Filter Source Data  
Learn how to create Excel dashboards.
   

       Home     Excel Tips     Excel Files      Blog    Contact

RSS Feed

Privacy Policy

 

 

The Excel Store

 

Last updated: February 20, 2009 11:28 PM