-1

I have a table of products, with multiple QTYs by month. How do I convert this table into a 2-columns list - one for QTY, one for month.

Source Data:

Product | 2019-06 | 2019-07 | 2019-08 | 2019-09 | 2019-10
----------------------------------------------------------
Apple   |   10    |   10    |   20    |   25    |   10
Orange  |   50    |   100   |   75    |   50    |   100

Desired Output:

Product | QTY | Date
---------------------
Apple   |  10 | 2019-06
Apple   |  10 | 2019-07
Apple   |  20 | 2019-08
Apple   |  25 | 2019-09
Apple   |  10 | 2019-10
Orange  |  50 | 2019-06
Orange  | 100 | 2019-07
Orange  |  75 | 2019-08
Orange  |  50 | 2019-09
Orange  | 100 | 2019-10
MrMusAddict
  • 427
  • 1
  • 6
  • 16
  • 1
    see: https://stackoverflow.com/questions/20541905/convert-matrix-to-3-column-table-reverse-pivot-unpivot-flatten-normal – Scott Craner Jun 27 '19 at 20:53

1 Answers1

1

Use Power Query a free MS add-in since 2010, and distributed with Excel 2016+ as Get&Transform.

In the Power Query UI, select the first column and then Unpivot other columns. Rename the columns as needed.

Also see my answer to Resorting Table using Array for more details

enter image description here

Ron Rosenfeld
  • 53,870
  • 7
  • 28
  • 60