+ Reply to Thread
Results 1 to 4 of 4

Extract data from Pivot Table (If statement & GetPivotdata)

  1. #1
    Registered User
    Join Date
    07-18-2013
    Location
    NY, USA
    MS-Off Ver
    Excel 2007
    Posts
    19

    Smile Extract data from Pivot Table (If statement & GetPivotdata)

    Hi All,

    I'd like to extract some data from a pivot table if a cell matches another cell. For example, if a particular company offered sale, I want to list all the years they had sale in separated by commas. I have a pivot table where the Company numbers (titled 'Company') and years (titled 'year') are in the Report Filter section.

    Then, in an excel tab I have the following:


    Company Year Sale
    1 sale
    2 no sale
    3 sale

    So, I'd like to have a macro which can input the years in Column 2 from the pivot for company 1 if Column 3 says sale.

    So, I'd get something like below:

    Company Year Sale
    1 2012, 2013, 2014 sale
    2 no sale
    3 2014, 2015 sale


    Many thanks in advance

  2. #2
    Registered User
    Join Date
    09-15-2015
    Location
    Lodz, Poland
    MS-Off Ver
    2010
    Posts
    16

    Re: Extract data from Pivot Table (If statement & GetPivotdata)

    I guess it would be easier to create new pivot table with Company and Years data and put Sale on a report filter to filter only ‘sale’ and then create macro to extract data you need.

    It would be easier if you could attach file or describe in more details how does source looks like.

  3. #3
    Registered User
    Join Date
    07-18-2013
    Location
    NY, USA
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Extract data from Pivot Table (If statement & GetPivotdata)

    @wator89 - That's a good idea. In the pivot table I've Company Numbers and then years for all those companies in the Report Filter Area. So I could extract the data into a "working tab" where in column A I could have all the company numbers and in B have the years listed.

    Can someone write me a macro to do the above?

    Thanks

  4. #4
    Registered User
    Join Date
    09-15-2015
    Location
    Lodz, Poland
    MS-Off Ver
    2010
    Posts
    16

    Re: Extract data from Pivot Table (If statement & GetPivotdata)

    Please attach sample file with:
    -pivot source sheet
    -pivot report sheet
    -sample output sheet

    Please leave all headers, layout, etc. as it is. For test purposes you could substitute you data with some simple dummy data.

+ 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. Extract data from Pivot Table (If statement & GetPivotdata)
    By rose9812in in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-14-2015, 10:51 AM
  2. I need to get data from Pivot Table via getpivotdata formula
    By joeycrak in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-24-2013, 05:14 PM
  3. Extracting data from pivot table using getPivotData function
    By shantanuk in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 12-24-2012, 08:20 AM
  4. Extract data from Pivot Table
    By Skipper Jones in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 08-01-2012, 07:45 PM
  5. Pivot Table help - Getpivotdata
    By pdawg123 in forum Excel General
    Replies: 1
    Last Post: 03-21-2012, 09:47 AM
  6. Pivot Table double click extract/ GETPIVOTDATA()
    By zonino in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-21-2009, 04:15 PM
  7. GETPIVOTDATA-on a pivot table
    By Hennie in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-06-2006, 06:50 PM

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