Transposing unknown number of sets of 7 columns into rows

damballa

New Member
Joined
Jan 16, 2018
Messages
1
Dear All,

I wonder if anybody can help. We are getting a pretty difficult output from one of our surveys.
It looks like this:
[TABLE="width: 500"]
<tbody>[TR]
[TD]No[/TD]
[TD]Detail[/TD]
[TD]ON[/TD]
[TD]OFF[/TD]
[TD]T[/TD]
[TD]Pay[/TD]
[TD]P[/TD]
[TD]D[/TD]
[TD]Comment[/TD]
[TD]ON[/TD]
[TD]OFF[/TD]
[TD]T[/TD]
[TD]Pay[/TD]
[TD]P[/TD]
[TD]D[/TD]
[TD]Comment[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]12345[/TD]
[TD]1[/TD]
[TD]7[/TD]
[TD]12[/TD]
[TD]0[/TD]
[TD]1[/TD]
[TD]0[/TD]
[TD][/TD]
[TD]5[/TD]
[TD]12[/TD]
[TD]16[/TD]
[TD]0.50[/TD]
[TD]1[/TD]
[TD]0[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]12346[/TD]
[TD]2[/TD]
[TD]8[/TD]
[TD]10[/TD]
[TD]0[/TD]
[TD]2[/TD]
[TD]0[/TD]
[TD][/TD]
[TD]7[/TD]
[TD]11[/TD]
[TD]20[/TD]
[TD]0[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Problem we have is that the columns can go on to a different depth in each line entry. So line 1 could have 49 columns and line 2 could have 70 columns Ideally we would like the output to be like this :
[TABLE="width: 500"]
<tbody>[TR]
[TD]NO[/TD]
[TD]Detail[/TD]
[TD]ON[/TD]
[TD]OFF[/TD]
[TD]T[/TD]
[TD]Pay[/TD]
[TD]P[/TD]
[TD]D[/TD]
[TD]Comment[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]12345[/TD]
[TD]1[/TD]
[TD]7[/TD]
[TD]12[/TD]
[TD]0[/TD]
[TD]1[/TD]
[TD]0[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]12345[/TD]
[TD]5[/TD]
[TD]12[/TD]
[TD]16[/TD]
[TD]0.50[/TD]
[TD]1[/TD]
[TD]0[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]12346[/TD]
[TD]2[/TD]
[TD]8[/TD]
[TD]10[/TD]
[TD]0[/TD]
[TD]2[/TD]
[TD]0[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]12346[/TD]
[TD]7[/TD]
[TD]11[/TD]
[TD]20[/TD]
[TD]0[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

So I would like to transpond every 7 columns into rows. I have done so but only per each line and I had to find out where it ends as well as insert more lines (yes I am not great with formulas I am afraid). I was wondering if any of you would know about a better and smarter way of doing this.

Thank you.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,223,712
Messages
6,174,031
Members
452,542
Latest member
Bricklin

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