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»VLOOKUP on Pivot Table – Everything You Need to Know

    VLOOKUP on Pivot Table – Everything You Need to Know

    Asmi DhakalBy Asmi DhakalJuly 30, 2023 Excel 4 Mins Read

    VLOOKUP pushes the envelope when used on a lookup table. With this, you can look for and retrieve data, check for accuracy, merge data, create automatic reports, and much more. However, this functionality of VLOOKUP ends up being quite limited on a PivotTable.

    The PivotTable summarizes a large data table in to manageable and interactive layout. So, instead of using ranges, it creates fields of data. VLOOKUP takes cells and cell ranges as references from a data table. This functionality, unfortunately, is not supported by Pivot Tables.

    While you can still use VLOOKUP on a PivotTable, I would highly suggest you look into the GETPIVOTDATA() function in Excel. The function is quite similar to VLOOKUP but takes in row and column references instead of cells. In this article, I will go into detail about using VLOOKUP in a PivotTable, and also discuss its limitations.

    VLOOKUP on PivotTable

    Take a look at this Pivot Table. Here, we have a list of all food items purchased by a catering company.

    Let’s use VLOOKUP to look up the total number of White chocolates purchased by the company. We created a little table on range F7:G8 to help look up our value. Here is how we will be constructing our formula using the VLOOKUP function:

    =VLOOKUP(G7,A3:D195,3,0)
    Use VLOOKUP in PivotTable

    Why NOT to Use VLOOKUP on a PivoTable in Excel

    You may be thinking, “Hey, I thought you said VLOOKUP does not work on PivotTables!”. Well, it’s a mix of yes and no. You may be thinking that VLOOKUP just worked on our PivotTable, but it actually only reflected the value that is currently on the cell.

    PivotTables use fields that are made up of the rows and columns of your source data table. You can switch what fields you wish to see as what values are in the field list. In our PivotTable, we have currently selected the fields for product_name, product_price, quantity, and total_price.

    Let’s see what happens when we switch out one of these fields from the PivotTable.

    Remove PivotTable Field

    Oops! According to VLOOKUP, the total quantity purchased for Chocolate-White is now 2246.88. Investigating the formula, we see that VLOOKUP is still referencing the value in the third column, adjacent to Chocolate – White. When we switched out the field for the product_price, the Sum of total_price became our third column.

    What to Use Instead of VLOOKUP in a PivotTable

    Now that we’ve established that VLOOKUP does not extract values from a PivotTable but simply the cell location, here comes the real question: What can you use instead of VLOOKUP on a Pivot Table? Well, you can use GETPIVOTDATA instead of VLOOKUP!

    What is GETPIVOTDATA?

    GETPIVOTDATA is a lookup function in Excel, that extracts value from a PivotTable by taking the field name and item as a reference. In contrast to VLOOKUP, GETPIVOTDATA does not take cell locations as a reference.

    Here is the syntax GETPIVOTDATA follows when constructing a formula:

    =GETPIVOTDATA(data_field, pivot_table, [field_1,item_1], [field_2,item_2],...)

    Here’s something interesting about PivotTables. When you enter the equals to operator (=) and click on any location inside your spreadsheet, you’d expect to see the cell location. This is not the case when it comes to PivotTables.

    PivotTable Field

    When I clicked on the cell C10 of a PivotTable, I got =GETPIVOTDATA("Sum of total_price",$A$3,"product_name","Bacardi Breezer - Strawberry") instead of the typical =D10 reference.

    This is the value of your data field. As we discussed before, PivotTable does not hold its data in cells, therefore, it does not return a cell reference. Now that we know what the role of GETPIVOTDATA is, let’s build a formula to look up our values on a PivotTable.

    How to Use GETPIVOTDATA on a PivotTable

    Firstly, you will need to specify the data field, and the name of your pivot table to get a value. Then, you have to enter the field name and item that holds the data you wish to look up. Let’s use the same example and check the quantity of Chocolate – White in our PivotTable using GETPIVOT.

    Here’s the formula we will be using:

    =GETPIVOTDATA("Sum of quantity",$A$3,F7,G7)
    GETPIVOTDATA in Excel

    Let’s break down the arguments used in this function:

    SyntaxArgumentReturnsDescription
    data_field“Sum of quantity”Sum of quantityAs our data is in the “Sum of quantity” field, this will be our reference for data_field. Do not use a cell reference for this argument as it will return the #REF error.
    pivot_table$A$3Food ListThe name of your PivotTable. This is usually the column header of the first column.
    [field_1F7product_nameThe name of the field your item is in
    item_1]G7Chocolate – WhiteThe name of the item
    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
      • VLOOKUP on PivotTable
      • Why NOT to Use VLOOKUP on a PivoTable in Excel
      • What to Use Instead of VLOOKUP in a PivotTable
        • What is GETPIVOTDATA?
        • How to Use GETPIVOTDATA on a PivotTable
      • Home
      • About Us
      • Privacy Policy
      © 2025 Inside The Web

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