Converting Bill of Materials to Pivot Table

keelaboosa

New Member
Joined
Apr 3, 2018
Messages
35
I've got a BOM in the following format:

[TABLE="class: grid, width: 250"]
<tbody>[TR]
[TD]Item
[/TD]
[TD]Description
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Pants
[/TD]
[/TR]
[TR]
[TD]1.1
[/TD]
[TD]Right Pants Pocket
[/TD]
[/TR]
[TR]
[TD]1.1.1
[/TD]
[TD]Keys
[/TD]
[/TR]
[TR]
[TD]1.1.2
[/TD]
[TD]Change
[/TD]
[/TR]
[TR]
[TD]1.1.3
[/TD]
[TD]Phone
[/TD]
[/TR]
[TR]
[TD]1.2
[/TD]
[TD]Left Pants Pocket
[/TD]
[/TR]
[TR]
[TD]1.3
[/TD]
[TD]Back Pants Pocket
[/TD]
[/TR]
[TR]
[TD]1.3.1
[/TD]
[TD]Wallet
[/TD]
[/TR]
[TR]
[TD]1.3.2
[/TD]
[TD]Comb
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]Hat
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]Shirt
[/TD]
[/TR]
[TR]
[TD]3.1
[/TD]
[TD]Right Shirt Pocket
[/TD]
[/TR]
[TR]
[TD]3.2
[/TD]
[TD]Left Shirt Pocket
[/TD]
[/TR]
</tbody>[/TABLE]


I want to turn into this format for a pivot table
[TABLE="width: 162"]
<tbody>[TR]
[TD]
[TABLE="class: grid, width: 300"]
<tbody>[TR]
[TD]L1
[/TD]
[TD]L2
[/TD]
[TD]L3
[/TD]
[/TR]
[TR]
[TD]Pants
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Pants
[/TD]
[TD]Right Pants Pocket
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Pants
[/TD]
[TD]Right Pants Pocket
[/TD]
[TD]Keys
[/TD]
[/TR]
[TR]
[TD]Pants
[/TD]
[TD]Right Pants Pocket
[/TD]
[TD]Change
[/TD]
[/TR]
[TR]
[TD]Pants
[/TD]
[TD]Right Pants Pocket
[/TD]
[TD]Phone
[/TD]
[/TR]
[TR]
[TD]Pants
[/TD]
[TD]Left Pants Pocket
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Pants
[/TD]
[TD]Back Pants Pocket
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Pants
[/TD]
[TD]Back Pants Pocket
[/TD]
[TD]Wallet
[/TD]
[/TR]
[TR]
[TD]Pants
[/TD]
[TD]Back Pants Pocket
[/TD]
[TD]Comb
[/TD]
[/TR]
[TR]
[TD]Hat
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Shirt
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Shirt
[/TD]
[TD]Right Shirt Pocket
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Shirt
[/TD]
[TD]Left Shirt Pocket
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]I've figure out how to split the Item column from the first table using Power Query, but I'm at a loss how to get the correct Descriptions in the appropriate cells.

Any ideas?
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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