Search Contextures Sites

Excel Pivot Table Tutorial -- GetPivotData

  1. Generate GetPivotData
  2. Watch the Excel Pivot Table Tutorial Video
  3. GetPivotData Formula
  4. Using Cell References in GetPivotData

Download the zipped sample file for this Excel pivot table tutorial

 

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. In this pivot table tutorial you'll see how to work around that problem, or to prevent it from occurring.

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 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 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 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

Excel Pivot Tables -- Introduction 
Excel Pivot Tables -- Create a Pivot Table in Excel 2007 
Excel Pivot Tables -- Data Field Layout
Excel Pivot Tables -- Show and Hide Items
Excel Pivot Tables -- Clear Old Items
Excel Pivot Tables -- Field Settings
Excel Pivot Tables -- GetPivotData
Excel Pivot Tables -- Grouping Data
Excel Pivot Tables -- Multiple Consolidation Ranges
Excel Pivot Tables -- Printing   
Excel Pivot Tables -- Custom Calculations 
Excel Pivot Tables -- Pivot Cache     
Excel Pivot Tables -- Protection  
Excel Pivot Tables -- Grand Totals
Excel Pivot Tables -- Running Totals  
Excel Pivot Tables -- Filter Source Data  
   
Learn how to create Excel dashboards.
   

       Home     Excel Tips     Excel Files     The Excel Store     Blog     Contact

 

Privacy Policy

 

Contextures Inc., Copyright © 2009.
All rights reserved.

 

Last updated: December 6, 2009 2:39 AM