Transform data.. pls help!

gato88

New Member
Joined
Feb 10, 2014
Messages
25
Hi

I have a table with the following columns:
[TABLE="class: cms_table, width: 500, align: left"]
<tbody>[TR]
[TD]Code[/TD]
[TD]Name[/TD]
[TD]Master Code[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]Test1[/TD]
[TD]125[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]Test1[/TD]
[TD]983[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]Test1[/TD]
[TD]608[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]Test2[/TD]
[TD]452[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]Test2[/TD]
[TD]367[/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]Test3[/TD]
[TD]195[/TD]
[/TR]
[TR]
[TD]D...[/TD]
[TD]...[/TD]
[TD]....[/TD]
[/TR]
</tbody>[/TABLE]












I would like to reformat the data in this format:
[TABLE="class: cms_table, width: 500, align: left"]
<tbody>[TR]
[TD]Code[/TD]
[TD]Master Code 1[/TD]
[TD]Master Code 2[/TD]
[TD]Master Code...[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]125[/TD]
[TD]983[/TD]
[TD]608[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]452[/TD]
[TD]367[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]195[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]D...[/TD]
[TD]...[/TD]
[TD]...[/TD]
[TD]...[/TD]
[/TR]
</tbody>[/TABLE]








I tried using the CrossTab Query function but it comes up with a "too many headers" error.
confused.png

Your assistance is much appreciated. Thanks!
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
The first exhibit is in A:C.

The second starts in E and E houses distinct codes of interest.

F2, control+shift+enter, not just enter, copy across, and down:

=IFERROR(INDEX($C$2:$C$100,SMALL(IF($A$2:$A$100=$E2,ROW($C$2:$C$100)-ROW($C$2)+1),COLUMNS($F2:F2))),"")
 
Upvote 0
Crosstabs have a limit of 255 fields. Use Aladin's formula solution in Excel as a workaround.

Denis
 
Upvote 0

Forum statistics

Threads
1,223,261
Messages
6,171,076
Members
452,377
Latest member
bradfordsam

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