+ Reply to Thread
Results 1 to 7 of 7

Normalizing historical data with a pivot table parse

  1. #1
    Registered User
    Join Date
    12-31-2008
    Location
    Alaska, (not Anchorage)
    MS-Off Ver
    Excel 2010, 2016, and 365
    Posts
    78

    Normalizing historical data with a pivot table parse

    I have several historic data sets that I would like to normalize to a common structure.

    I would like to convert this:
    date |area | color | Dodge | BMW | Delorean | Ford
    12/2/2012 | London | blue | 2 | 3 | 1 | 6
    12/3/2012 | Tokyo | green | 1 | 5 | 2 | 1
    12/3/2012 | Juneau | white | 0 | 1 | 1 | 9
    to this:
    date | area | color | quantity | make
    12/2/2012 | London | blue | 2 | Dodge
    12/2/2012 | London | blue | 3 | BMW
    12/2/2012 | London | blue | 1 | Delorean
    12/2/2012 | London | blue | 6 | Ford
    12/3/2012 | Tokyo | green | 1 | Dodge
    12/3/2012 | Tokyo | green | 5 | BMW
    12/3/2012 | Tokyo | green | 2 | Delorean
    12/3/2012 | Tokyo | green | 1 | Ford
    12/3/2012 | Juneau | white | 0 | Dodge
    12/3/2012 | Juneau | white | 1 | BMW
    12/3/2012 | Juneau | white | 1 | Delorean
    12/3/2012 | Juneau | white | 9 | Ford
    Is this something that pivot table can handle?
    I confess to being a bit lost regarding how to frame this problem...even though it seems so simple!
    TIA for ideas and suggestions.

  2. #2
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Normalizing historical data with a pivot table parse

    I would say a PivotTable is better at converting from what you want to what you have in this case.
    I think it makes sense to convert it into the format you want, that way you can use pivot table on it and get all kinds of information out of it with a few clicks.
    I'll try to write some macro code soon. Unless someone beats me to it.
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  3. #3
    Registered User
    Join Date
    12-31-2008
    Location
    Alaska, (not Anchorage)
    MS-Off Ver
    Excel 2010, 2016, and 365
    Posts
    78

    Re: Normalizing historical data with a pivot table parse

    Nuts: I was hoping that there was a pivot table nuance that I was missing that would allow this in a simple and elegant manner. I am interested in your thoughts regarding a macro that does this. Thanx.

  4. #4
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Normalizing historical data with a pivot table parse

    Code is not slow but it looks awkward.
    Should do the job for you.
    Attached Files Attached Files

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Normalizing historical data with a pivot table parse

    here is a formula approach
    Attached Files Attached Files
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  6. #6
    Registered User
    Join Date
    12-31-2008
    Location
    Alaska, (not Anchorage)
    MS-Off Ver
    Excel 2010, 2016, and 365
    Posts
    78

    Re: Normalizing historical data with a pivot table parse

    Both of the proposed solutions still work like a charm ...eight years later. Thanks.

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Normalizing historical data with a pivot table parse

    Always good to see older suggestions still being valid and helpful!!
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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