Mapping from Rows into Columns with Shared Values

Grothgar101

New Member
Joined
Feb 8, 2018
Messages
3
Hi All;

I have a lot of data (some of which I've shown below) that I'm trying to map in a certain way.

[TABLE="width: 195"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD="align: right"]27[/TD]
[TD="align: right"]1005516[/TD]
[/TR]
[TR]
[TD="align: right"]1005510[/TD]
[TD="align: right"]1005511[/TD]
[/TR]
[TR]
[TD="align: right"]1005510[/TD]
[TD="align: right"]1005514[/TD]
[/TR]
[TR]
[TD="align: right"]1005511[/TD]
[TD="align: right"]1005411[/TD]
[/TR]
[TR]
[TD="align: right"]1005511[/TD]
[TD="align: right"]1005513[/TD]
[/TR]
[TR]
[TD="align: right"]1005512[/TD]
[TD="align: right"]1005510[/TD]
[/TR]
[TR]
[TD="align: right"]1005513[/TD]
[TD="align: right"]1005410[/TD]
[/TR]
[TR]
[TD="align: right"]1005515[/TD]
[TD="align: right"]1005512[/TD]
[/TR]
[TR]
[TD="align: right"]1005516[/TD]
[TD="align: right"]1005515[/TD]
[/TR]
[TR]
[TD="align: right"]35[/TD]
[TD="align: right"]1005640[/TD]
[/TR]
[TR]
[TD="align: right"]1005510[/TD]
[TD="align: right"]1005511[/TD]
[/TR]
[TR]
[TD="align: right"]1005510[/TD]
[TD="align: right"]1005514[/TD]
[/TR]
[TR]
[TD="align: right"]1005511[/TD]
[TD="align: right"]1005411[/TD]
[/TR]
[TR]
[TD="align: right"]1005511[/TD]
[TD="align: right"]1005513[/TD]
[/TR]
[TR]
[TD="align: right"]1005512[/TD]
[TD="align: right"]1005510[/TD]
[/TR]
[TR]
[TD="align: right"]1005513[/TD]
[TD="align: right"]1005410[/TD]
[/TR]
[TR]
[TD="align: right"]1005515[/TD]
[TD="align: right"]1005512[/TD]
[/TR]
[TR]
[TD="align: right"]1005640[/TD]
[TD="align: right"]1005515[/TD]
[/TR]
</tbody>[/TABLE]

The small code (27, 35 etc) is the actual material number, and then the larger codes are ingredients that go into it.
For example, 35 is fed by 1005640, which is fed by 1005515, which is fed by 1005512 which is fed by 1005510 which is fed by both 1005511 & 1005514.

And it's the fact that some levels are fed by multiple ingredients that is causing me an issue in mapping which levels fall into what upper levels. If it was a 1 for 1 mapping, then I could just do a VLOOKUP on each level and find the correct data. This approach get's me about 40% of the way there, but given there are over 5000 products, that doesn't help me that much!

So, is there a formula, a way of working, or some VBA Code that will take the information I have above, and then map it into columns, with the material number first, the second level ingredient next, then third, then 4th etc?

Thanks in Advance.
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Forum statistics

Threads
1,224,819
Messages
6,181,153
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