Hierarchical Table to a PivotTable (or something similar)

tazeo

Board Regular
Joined
Feb 15, 2007
Messages
133
Office Version
  1. 365
Platform
  1. Windows
Hi everyone,

I'm struggling with transforming a complex Hierarchical Table into a format suitable for creating a PivotTable. The existing data structure is proving challenging to work with.

Current Data Structure (example):
Level 04level 05level 06level 07level 08level 09UnitNamePositionCount
CEO
Corporate Affairs
Brand
Digital Content
Null (1)
Null (1)
Brand
BobManager1
Null (1)

The dataset contains approximately 1,000 rows. The "Null (x)" entries appear in columns Level 05 through Level 09. When a column contains "Null (x)", it should inherit the value from the previous non-null column to its left.

Desired Output:
Level 04Level 05Level 06Level 07Level 08Level 09UnitNamePositionCount
CEOCorporate AffairsBrandDigital ContentDigital ContentDigital ContentBrandBobManager1
CEOCorporate AffairsBrand.........

I can clean this manually, but it's too time-consuming for the volume of data I'm working with. I believe there must be a way to automate this process, as it's a repetitive task.
Questions:
  1. Is there an efficient way to handle the "Null (x)" entries? This is where I'm getting stuck.
  2. Would Power Query be an appropriate tool for this task?
  3. Are there any other approaches or tools you'd recommend?

I've been grappling with this for a while, so I apologize if my explanation isn't entirely clear. I'm open to providing any necessary clarifications. Thanks in advance for your help!
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Forum statistics

Threads
1,223,931
Messages
6,175,465
Members
452,646
Latest member
tudou

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