ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Reverse Pivot-type Data (that's not a pivot table) (https://www.excelbanter.com/excel-discussion-misc-queries/186953-reverse-pivot-type-data-thats-not-pivot-table.html)

Eric

Reverse Pivot-type Data (that's not a pivot table)
 
Data is not in an actual pivot table (so it can't be reversed to get what I
want), it's just entered in a crosstab format:

June July August
Andy 2 3 4
Dave 3 6 2

Any easy way to convert it to this format?

Name Month Sales
Andy June 2
Andy July 3
Andy August 4
Dave June 3
Dave July 6
Dave August 2

TIA.

Max

Reverse Pivot-type Data (that's not a pivot table)
 
Assuming source table below is in A1:D3
June July August
Andy 2 3 4
Dave 3 6 2


In F2: =OFFSET($A$2,INT((ROWS($1:1)-1)/3),)
In G2: =INDEX($B$1:$D$1,MOD(ROWS($1:1)-1,3)+1)
In H2: =OFFSET($B$2,INT((ROWS($1:1)-1)/3),MOD(ROWS($1:1)-1,3))
Copy F2:H2 down to H7 to extract desired results
Adapt to suit .. eg: the "3" = the number of "month" cols in the source
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Eric" wrote:
Data is not in an actual pivot table (so it can't be reversed to get what I
want), it's just entered in a crosstab format:

June July August
Andy 2 3 4
Dave 3 6 2

Any easy way to convert it to this format?

Name Month Sales
Andy June 2
Andy July 3
Andy August 4
Dave June 3
Dave July 6
Dave August 2

TIA.


Ed Ferrero[_2_]

Reverse Pivot-type Data (that's not a pivot table)
 
You can also use this cool method from J Walkenbach's site
http://www.j-walk.com/ss/excel/usertips/tip068.htm

Ed Ferrero
www.edferrero.com


All times are GMT +1. The time now is 03:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com