Forum Discussion
Transforming rows and columns to a sequence of rows
- Aug 31, 2017
Hello,
Power Query can be used for that. First, copy all column labels into all rows, like this:
Then load the table into Power Query (called Get&Transform) in Excel 2016. Select Column 1 and then click Unpivot other columns. Combine the two columns you want to keep and delete the rest. The result looks like this:
If anyone else is viewing this post and they aren't familiar with the easy method (Power Query). It's also possible to accomplish this with workbook formulas.
=IF(ISBLANK(INDIRECT("Sheet1!A"&(INT((ROW(D1)-1)/3)+1)+1)),"",INDIRECT("Sheet1!A"&(INT((ROW(D1)-1)/3)+1)+1))&IF(ISBLANK(INDIRECT("Sheet1!"&CHAR(65+ROW())&1)),INDIRECT("Sheet2!B"&(ROWS($B$1:B1)-3)),INDIRECT("Sheet1!"&CHAR(65+ROW())&1))
WHERE 3 = COLUMN HEADER COUNT
THIS COULD EASILY BE REPLACED WITH COUNTA()....
See attached workbook for an example.