+ Reply to Thread
Results 1 to 5 of 5

Can I use VLOOKUP in the pivot fields to pull data from a pivot table?

  1. #1
    Registered User
    Join Date
    09-19-2014
    Location
    Miami, FL
    MS-Off Ver
    Mac 2013
    Posts
    67

    Can I use VLOOKUP in the pivot fields to pull data from a pivot table?

    Hello. In the ‘Positions Pivot’ tab, in column B, I want to display the industry of each stock listed in column A. The industry data is to be pulled from the pivot table in the ’Positions’ tab (column P). Just want to point out that this industry data is pulled using VLOOKUP from the ‘Summarizer Lite’ tab (column B). I am a bit new to pivot tables so I was hoping for some suggestions on how to do this. Thanks.
    Attached Files Attached Files

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Can I use VLOOKUP in the pivot fields to pull data from a pivot table?

    You can solve this by overlaying the pivot table with a named dynamic range and use that as the lookup source for the VLOOKUP.

    The following makes a couple of assumptions. Te first cell with data in the pivot table is A6 everything above that is either header or data. Likewise there are 19 columns returned in the pivot table.

    Here is information on named dynamic ranges: http://www.utteraccess.com/wiki/Offs...Dynamic_Ranges

    In this case, create a name called Lookup_Data with the following reference =OFFSET('Summarizer Lite'!$A$6,0,0,COUNTA('Summarizer Lite'!$A:$A)-4,19)

    What this name means is:
    Start in Cell A6
    Go down 0 rows
    Go right 0 Columns (so we are still in A6)
    give me a range COUNTA(A:A)-4 rows deep and 19 rows wide

    The reason for the -4 is that we don't want to count the header and other information you have above the data.

    Then you can use VLOOKUP with Lookup_Data as the table you go to to look up the data. E.g. =VLOOKUP(A2,Lookup_data,2,False)
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    09-19-2014
    Location
    Miami, FL
    MS-Off Ver
    Mac 2013
    Posts
    67

    Re: Can I use VLOOKUP in the pivot fields to pull data from a pivot table?

    Thanks for the reply dflak. I think I understand how to create the dynamic named range that overlaps with the pivot table, but where do I type the VLOOKUP formula =VLOOKUP(A2,Lookup_data,2,False)? When I try and type it in column B of the pivot fields, I get an error message saying you can't change this part of the pivot table.

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Can I use VLOOKUP in the pivot fields to pull data from a pivot table?

    My apologies, I did not understand the requirement. I thought you wanted to use the results of the pivot table to do further analysis elsewhere.

    Also you don't need the dynamic range you have the data in a table which is even better.

    The solution is a lot simpler than my misunderstanding of the requirement led me to believe.

    I took the positions data and made a table out of it. It's just easier to work with tables. Then I made a pivot table of it on Sheet1. Instead of putting the Industry as data, I put it as an additional row in the pivot table.

    Then right click on the symbol, select Field Settings. Click on None for subtotals and then go to the layout and print tab and click on Show item labels in tabular form.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-19-2014
    Location
    Miami, FL
    MS-Off Ver
    Mac 2013
    Posts
    67

    Re: Can I use VLOOKUP in the pivot fields to pull data from a pivot table?

    Nice. It did seem like something relatively simple, but I'm just starting out. Thanks so much for your help dflak.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] How to use VLookup to pull data from pivot table
    By Vernell10 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 08-23-2016, 01:30 PM
  2. [SOLVED] CONCATENATE fields in pivot table with vlookup
    By sachbo in forum Excel General
    Replies: 8
    Last Post: 08-11-2015, 08:00 AM
  3. Replies: 4
    Last Post: 06-19-2014, 12:59 PM
  4. Convert Column Data Fields to Row Data Fields in pivot table
    By anavarathan in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 02-08-2014, 09:49 AM
  5. Collapse/Expand - Pivot table Fields - Need equivalent option in Excel VBA Pivot table
    By ragavendraph in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-07-2012, 03:00 PM
  6. Differentiate between column fields and data fields in a pivot table
    By whiteheadw in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-12-2009, 01:59 PM
  7. How to pull values from the pivot table fields, through the code/.
    By seven_snow in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-11-2006, 07:50 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1