Convert Merged cells to duplicates

BrianGGG

Board Regular
Joined
Mar 5, 2016
Messages
62
Hello. I have a worksheet that I don't have control over that looks like:

ABCDEFGHI
4Category 1Category 2Category 3
5Item 1Item 2Item 3Item 4Item 5Item 6Item 7Item 8Item 9
6abcdefghi

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet2



In it, there is a variable number of categories that has a variable number of items. The categories are above the items and those cells are merged (another reason to hate merged cells).


What I need to do is create a single-cell array that contains the categories and items in two columns, but the categories should be Repeated rather than blank in the array.
The layout should be similar to the following (in array form of course):

AB
12CategoryItem
13category 1Item 1
14category 1Item 2
15category 1Item 3
16Category 2Item 4
17Category 2Item 5
18Category 3Item 6
19Category 3Item 7
20Category 3Item 8
21Category 3Item 9

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet2





Any ideas? I'm struggling with a formula that will find "the non-zero value that is at or before the current column".



Thanks
BrianGGG
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
is that what you want?

CategoryItemsValues
Category 1Item 1a
Category 1Item 2b
Category 1Item 3c
Category 2Item 4d
Category 2Item 5e
Category 3Item 6f
Category 3Item 7g
Category 3Item 8h
Category 3Item 9i

try PowerQuery

Code:
[SIZE=1]let
    Source = Excel.CurrentWorkbook(){[Name="Table11"]}[Content],
    #"Transposed Table" = Table.Transpose(Source),
    #"Filled Down" = Table.FillDown(#"Transposed Table",{"Column1"}),
    #"Renamed Columns" = Table.RenameColumns(#"Filled Down",{{"Column1", "Category"}, {"Column2", "Items"}, {"Column3", "Values"}})
in
    #"Renamed Columns"[/SIZE]
 
Upvote 0
Thanks, appreciated and what I want... however I need it to be solved in an Excel formula so that some of my calculations update real-time.
 
Upvote 0

Forum statistics

Threads
1,215,044
Messages
6,122,827
Members
449,096
Latest member
Erald

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