0

Current Data Structure

The image above shows the current structure of the time series data that I am working with. It has many columns of time series data which are identified by the customer id in the header row. In order to use this data in a pivot table for analysis, I'd like to convert it to a format like the image below: enter image description here

Here the customer id becomes a dimension that describes the time series data.

Since this is a large data set, it would be a huge time sink to manually transform the data into the desired format. Also, I do not have fancy add-ins like Power Pivot or Power Query...

Using Excel VBA, how can I write a macro to handle this task?

Thanks,

2
  • 4
    excel.solutions/2014/03/unpivot-excel-data Commented Jul 25, 2015 at 4:33
  • 1
    this tutorial worked for me. thanks for sharing. I knew there was a way without writing VBA code. Commented Jul 25, 2015 at 5:12

1 Answer 1

1

Solution to problem can be found here: http://www.excel.solutions/2014/03/unpivot-excel-data

  1. Start off by pressing keys ALT > D > P to open the Pivot Table Wizard dialog box:

    Choose the ‘Multiple consolidation ranges’ option, then click ‘Next’

    • In step 2a of the wizard, choose the ‘I will create the page fields’ option, and click ‘Next’

    • Now we need to add our crosstab data range as a data source for this pivot table. Enter / select the appropriate range, then click ‘Add’. Then click ‘Next’.

  2. Choose a location for the intermediate pivot table (it’s a good idea to use a new worksheet, as we can simply delete the entire worksheet when we’re finished). Then click ‘Finish’.

  3. We now have an ‘intermediate’ pivot table, which looks very similar to our raw data, but has some grand totals. Now we want to drill into the source data for this pivot table, by double clicking on the overall Grand Total value – the cell intersection of the Grand Total column, and Grand Total row:

  4. By double clicking to drill into the grand total data source, another worksheet is created, containing a table with our unpivotted data:

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.