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.

271005516
10055101005511
10055101005514
10055111005411
10055111005513
10055121005510
10055131005410
10055151005512
10055161005515
351005640
10055101005511
10055101005514
10055111005411
10055111005513
10055121005510
10055131005410
10055151005512
10056401005515

<colgroup><col><col></colgroup><tbody>
</tbody>

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

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,214,395
Messages
6,119,265
Members
448,881
Latest member
Faxgirl

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