Transpose every 2 columns into new row, moving to new row after last column

prshntmv

New Member
Joined
Jul 18, 2019
Messages
2
Hi there,
I have a sheet in the following format[TABLE="width: 500"]
<tbody>[TR]
[TD]Date[/TD]
[TD]Key1[/TD]
[TD]Attr1[/TD]
[TD]Key2[/TD]
[TD]Attr2[/TD]
[TD]Key3[/TD]
[TD]Attr3[/TD]
[TD]Key4[/TD]
[TD]Attr4[/TD]
[/TR]
[TR]
[TD]1 Jan 2019[/TD]
[TD]1[/TD]
[TD]23[/TD]
[TD]3[/TD]
[TD]43[/TD]
[TD]3[/TD]
[TD]25[/TD]
[TD]1[/TD]
[TD]54[/TD]
[/TR]
[TR]
[TD]2 Jan 2019[/TD]
[TD]2[/TD]
[TD]23[/TD]
[TD]2[/TD]
[TD]23[/TD]
[TD]2[/TD]
[TD]54[/TD]
[TD]2[/TD]
[TD]23[/TD]
[/TR]
[TR]
[TD]3 Jan 2019[/TD]
[TD]4[/TD]
[TD]25[/TD]
[TD]1[/TD]
[TD]54[/TD]
[TD]4[/TD]
[TD]43[/TD]
[TD]2[/TD]
[TD]34[/TD]
[/TR]
[TR]
[TD]4 Jan 2019[/TD]
[TD]3[/TD]
[TD]23[/TD]
[TD]4[/TD]
[TD]23[/TD]
[TD]2[/TD]
[TD]32[/TD]
[TD]4[/TD]
[TD]23[/TD]
[/TR]
[TR]
[TD]5 Jan 2019[/TD]
[TD]1[/TD]
[TD]27[/TD]
[TD]1[/TD]
[TD]24[/TD]
[TD]1[/TD]
[TD]14[/TD]
[TD]2[/TD]
[TD]44[/TD]
[/TR]
</tbody>[/TABLE]

which I want to convert into the below format.

[TABLE="width: 500"]
<tbody>[TR]
[TD]Date[/TD]
[TD]Key[/TD]
[TD]Attr[/TD]
[/TR]
[TR]
[TD]1 Jan 2019[/TD]
[TD]1[/TD]
[TD]23[/TD]
[/TR]
[TR]
[TD]1 Jan 2019[/TD]
[TD]3[/TD]
[TD]43[/TD]
[/TR]
[TR]
[TD]1 Jan 2019[/TD]
[TD]2[/TD]
[TD]25[/TD]
[/TR]
[TR]
[TD]1 Jan 2019[/TD]
[TD]1[/TD]
[TD]54[/TD]
[/TR]
[TR]
[TD]2 Jan 2019[/TD]
[TD]2[/TD]
[TD]23[/TD]
[/TR]
[TR]
[TD]2 Jan 2019[/TD]
[TD]2[/TD]
[TD]23[/TD]
[/TR]
[TR]
[TD]2 Jan 2019[/TD]
[TD]2[/TD]
[TD]54[/TD]
[/TR]
[TR]
[TD]2 Jan 2019[/TD]
[TD]2[/TD]
[TD]23[/TD]
[/TR]
</tbody>[/TABLE]
And so on. This is essentially transposing every 2 columns (starting from Key1) into rows, until the last set of columns and then starting again with second row of Key1 column and so on.

Can any one please help?

Cheers
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
With PowerQuery (Get&Transform) try UnPivot Selected Columns for Keys then the same for Attr
 
Upvote 0
I don't know, maybe someone else will give you formula(s) solution

Have a nice day
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top