Inside The Web
    Facebook Twitter Instagram
    Inside The Web
    • Office
      • Excel
      • Ms Word
      • OneDrive
      • Google Docs
      • Google Sheets
      • Google Drive
    • Email
      • Gmail
      • Outlook
      • Emal Etiquette
    • Office Etiquette
    • Productivity
    Inside The Web
    Home»Office»Excel»GETPIVOTDATA in Excel- How to Use it

    GETPIVOTDATA in Excel- How to Use it

    Asmi DhakalBy Asmi DhakalAugust 3, 2023 Excel 6 Mins Read

    When you reference any cell from a pivot table, instead of the values, you will get a GETPIVOTDATA formula. This might confuse you if you are new to Excel or pivot table in general.

    So what is GETPIVOTDATA, and why is it so important to use it on a PivotTable?

    The GETPIVOTDATA function is classified under the lookup and reference functions and is used to look up values in a PivotTable.

    You may be thinking, “Aren’t there other functions like VLOOKUP to get values from PivotTables?” Well, no. GETPIVOTDATA is a dedicated function to get values from a PivotTable. In this article, we will be giving you a general overview of the GETPIVOTDATA and why you should be using it in PivotTables in Excel.

    What is GETPIVOTDATA in Excel?

    GETPIVOTDATA is a fairly old function in Excel. It uses the date field and PivotTable names to extract value from a PivotTable.

    What makes GETPIVOTDATA so special is that it does not depend on the cell location to extract values. This means, even if you hide the referenced cell from the PivotTable, the values remain intact. This is quite the opposite of VLOOKUP, which triggers the #N/A error when you hide the source range.

    NOTE: When entering Date values for a PivotTable, always enter them in numeric form or wrap them around the DATE function. This is important mostly when you’re sharing your sheet with other users as their system date and time format could be different from yours.

    Arguments used in GETPIVOTDATA in Excel

    Let’s dive deeper into what GETPIVOTDATA is by analyzing the arguments it uses. Here’s how GETPIVOTDATA is used when constructing a formula in Excel:

    =GETPIVOTDATA(data_field,pivot_table,[field1_item1],[field2_item2],[field3_item3]...)
    ArgumentData TypeDescription
    data_fieldTextThe field you wish to extract your value from. This is generally the column or row header.
    pivot_tableCell ReferenceThe row label of your PivotTable. This can be any reference under the label.
    [field1,item1]TextThe name of the reference field and its item.

    Let’s select a random value in your PivotTable and analyze it to see how GETPIVOTDATA works in Excel.

    I selected a field value in cell I8. Instead of getting =I8 in the formula bar, I received the =GETPIVOTDATA("Cost",$H$1,"Item Purchased","Refrigerator") formula. This formula is commanding Excel to retrieve the value in the data_field “Cost”, from the PivotTable in cell $H$1.

    As it is a specific value, this formula has also specified the field name, Items Purchased, and Refrigerator as a reference. Using these references, the formula extracts data from the data field, Cost.

    How to Use GETPIVOTDATA in Excel?

    We have arranged a list of examples to help you understand the application of GETPIVOTDATA in Excel.

    Example 1: Get the PivotTable Summary Using GETPIVOTDATA

    When you create a PivotTable, it automatically creates a summary of your values. In this PivotTable, the summary of field, “Cost” is next to the label, “Grand Total”. As this is a smaller PivotTable, analyzing this data is easier, however, you would have to use GETPIVOTDATA in case of a larger PivotTable.

    Here’s how I constructed my formula using the GETPIVOTDATA function to get the summary of my values:

    =GETPIVOTDATA("Cost",$H$1)

    Example 2: Look Up a Value Using GETPIVOTDATA

    This is probably the most used application of the GETPIVOTDATA function. When you extract value using the GETPIVOTDATA, even when you change the field and its values, the value remains unfazed. This way, you can analyze other data while still viewing data from other fields.

    Let’s use GETPIVOTDATA to look up the “Sum of Cost” value of the item, “Stove”. This is how I created the formula:

    =GETPIVOTDATA("Cost",$H$1,"Item Purchased","Stove")

    Example 3: Look Up Values using Dates in GETPIVOTDATA

    You can refer to months from serial numbers 1-12 in the GETPIVOTDATA formula. Similarly, quarters are grouped from 1-4. Instead of entering the month and quarter names, you have to enter the serial numbers to look up a value.

    In this PivotTable, we have arranged each Item Purchased and their Cost values under Jan and Feb. If you look closer, the item, Stove was purchased in both Jan and Feb. Let’s create a lookup formula using GETPIVOTDATA to extract the total cost of purchasing Stove in the month of Jan.

    =GETPIVOTDATA("Cost",$A$21,"Item Purchased","Stove","Months (Date)",1)

    Here, the field we’re looking for data from is Cost. Therefore, that will be our argument for data_field. As our PivotTable start from cell $A$21, that will be our next reference. The item we’re looking for the cost for is Stove, which is in the Item Purchased field. Therefore, they will be our next arguments.

    Moving on, we’re looking for the cost of the Stove for the month of January. In our PivotTable, months are grouped under the Months(Date) field. As Jan is denoted by the serial number 1, these values will be our second field and item respectively.

    Errors in GETPIVOTDATA

    When learning a new function, we oftentimes stumble over a few errors. Here are some of the common errors you may encounter when learning to use GETPIVOTDATA correctly in Excel:

    #REF! Error

    If you keep getting the #REF! error, even when you have correctly typed in your formula, it is because your field item isn’t currently visible on the sheet. Try bringing the data back on the spreadsheet and see if it resolves your issue.

    REF Error Excel

    If you’re still facing issues, check your formula and the cells you’ve referenced again.

    #NAME? Error

    You will mostly encounter the #NAME? error in Excel if you’ve mistyped the name of your function. This is more of a common occurrence when learning a new function and it definitely doesn’t help that GETPIVOTDATA is a long name for a function.

    NAME Error in GETPIVOTDATA

    To avoid the #NAME? error, use the Insert Function tool when creating or using a formula in Excel. You can look for functions through their category or even their description. 

    Incorrect Result

    When learning a new function, you may sometimes end up with an incorrect result. Don’t worry, mistakes are a part of the learning process.

    If your formula returns an incorrect result, select the cell and check the formula in the formula bar. Make sure you’re referencing the correct data_field. You can check the data_field from the PivotTable’s Field List.

    Formula Not Updating Dynamically

    You could’ve enabled manual calculation in your Excel program if your formulas aren’t updating dynamically. You can use F9 on your keyboard to refresh your spreadsheet or head on to the Formulas tab to change your calculation to automatic.

    1. Go to the Formulas tab.
    2. Select Calculation Options from the Calculation section.
    3. Choose Automatic.
      Set Calculation Settings to Automatic

    How to Avoid Errors using the GETPIVOTDATA

    Sometimes, you know you’re bound to get an error using the GETPIVOTDATA. Especially when the data you’re requesting to lookup is currently unavailable in your sheet. Errors are never a good look in the spreadsheet. Therefore, you can nest the GETPIVOTDATA function inside the IFERROR function to avoid displaying any errors.

    Arguments Used in IFERROR

    Here’s how IFERROR is written in a formula:

    =IFERROR(value, value_iferror)

    Nest GETPIVOTDATA inside IFERROR

    This is how you can next your GETPIVOTDATA function inside the IFERROR function to avoid displaying Excel errors:

    =IFERROR(GETPIVOTDATA(data_field,pivot_data,[field_1,item_1],[field_2,item_2],...),0)
    IFERROR in Excel

    This formula returns 0 instead of any Excel error.

    Advanced Excel Excel Functions
    Asmi Dhakal

      Asmi is a content writer specializing in MS Office. She loves writing Excel-related content to assist other users to learn their way around the program. She started using Excel when she first entered the industry as a marketing intern. Soon, she realized that learning the often-overlooked spreadsheet program was no piece of cake. In her articles, she attempts to brief out complex topics to help beginner to intermediate-level Excel users. Asmi uses Excel for everything, including creating a grocery list to managing her personal finance. She’s a bit dramatic when it comes to the Flash Fill feature; so much so that could write a eulogy out of it. When she’s not working, you’ll find her learning a new recipe, or cleaning up her mess (out of the failed recipe).

      Related Posts

      Excel By Nisha Gurung

      How to Compare Two Columns in Excel Using VLOOKUP

      Excel By Nisha Gurung

      How to Share Excel Files with Multiple Users

      Excel By Nisha Gurung

      How to Filter Based on a List in Excel

      Add A Comment
      Table of ContentsToggle Table of ContentToggle
      • What is GETPIVOTDATA in Excel?
      • Arguments used in GETPIVOTDATA in Excel
      • How to Use GETPIVOTDATA in Excel?
        • Example 1: Get the PivotTable Summary Using GETPIVOTDATA
        • Example 2: Look Up a Value Using GETPIVOTDATA
        • Example 3: Look Up Values using Dates in GETPIVOTDATA
      • Errors in GETPIVOTDATA
        • #REF! Error
        • #NAME? Error
        • Incorrect Result
        • Formula Not Updating Dynamically
      • How to Avoid Errors using the GETPIVOTDATA
        • Arguments Used in IFERROR
        • Nest GETPIVOTDATA inside IFERROR
      • Home
      • About Us
      • Privacy Policy
      © 2025 Inside The Web

      Type above and press Enter to search. Press Esc to cancel.