BrianGGG
Board Regular
- Joined
- Mar 5, 2016
- Messages
- 62
Hello. I have a worksheet that I don't have control over that looks like:
<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]4[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C6EFCE]#C6EFCE[/URL] , align: center"]Category 1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C6EFCE]#C6EFCE[/URL] , align: center"][/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C6EFCE]#C6EFCE[/URL] , align: center"][/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C6EFCE]#C6EFCE[/URL] , align: center"]Category 2[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C6EFCE]#C6EFCE[/URL] , align: center"][/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C6EFCE]#C6EFCE[/URL] , align: center"]Category 3[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C6EFCE]#C6EFCE[/URL] , align: center"][/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C6EFCE]#C6EFCE[/URL] , align: center"][/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C6EFCE]#C6EFCE[/URL] , align: center"][/TD]
[TD="align: center"]5[/TD]
[TD="bgcolor: #F2F2F2"]Item 1[/TD]
[TD="bgcolor: #F2F2F2"]Item 2[/TD]
[TD="bgcolor: #F2F2F2"]Item 3[/TD]
[TD="bgcolor: #F2F2F2"]Item 4[/TD]
[TD="bgcolor: #F2F2F2"]Item 5[/TD]
[TD="bgcolor: #F2F2F2"]Item 6[/TD]
[TD="bgcolor: #F2F2F2"]Item 7[/TD]
[TD="bgcolor: #F2F2F2"]Item 8[/TD]
[TD="bgcolor: #F2F2F2"]Item 9[/TD]
[TD="align: center"]6[/TD]
</tbody>
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):
<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]12[/TD]
[TD="align: center"]13[/TD]
[TD="align: center"]14[/TD]
[TD="align: center"]15[/TD]
[TD="align: center"]16[/TD]
[TD="align: center"]17[/TD]
[TD="align: center"]18[/TD]
[TD="align: center"]19[/TD]
[TD="align: center"]20[/TD]
[TD="align: center"]21[/TD]
</tbody>
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
A | B | C | D | E | F | G | H | I | |
---|---|---|---|---|---|---|---|---|---|
a | b | c | d | e | f | g | h | i |
<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]4[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C6EFCE]#C6EFCE[/URL] , align: center"]Category 1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C6EFCE]#C6EFCE[/URL] , align: center"][/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C6EFCE]#C6EFCE[/URL] , align: center"][/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C6EFCE]#C6EFCE[/URL] , align: center"]Category 2[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C6EFCE]#C6EFCE[/URL] , align: center"][/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C6EFCE]#C6EFCE[/URL] , align: center"]Category 3[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C6EFCE]#C6EFCE[/URL] , align: center"][/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C6EFCE]#C6EFCE[/URL] , align: center"][/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=C6EFCE]#C6EFCE[/URL] , align: center"][/TD]
[TD="align: center"]5[/TD]
[TD="bgcolor: #F2F2F2"]Item 1[/TD]
[TD="bgcolor: #F2F2F2"]Item 2[/TD]
[TD="bgcolor: #F2F2F2"]Item 3[/TD]
[TD="bgcolor: #F2F2F2"]Item 4[/TD]
[TD="bgcolor: #F2F2F2"]Item 5[/TD]
[TD="bgcolor: #F2F2F2"]Item 6[/TD]
[TD="bgcolor: #F2F2F2"]Item 7[/TD]
[TD="bgcolor: #F2F2F2"]Item 8[/TD]
[TD="bgcolor: #F2F2F2"]Item 9[/TD]
[TD="align: center"]6[/TD]
</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):
A | B | |
---|---|---|
Category | Item | |
category 1 | Item 1 | |
category 1 | Item 2 | |
category 1 | Item 3 | |
Category 2 | Item 4 | |
Category 2 | Item 5 | |
Category 3 | Item 6 | |
Category 3 | Item 7 | |
Category 3 | Item 8 | |
Category 3 | Item 9 |
<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]12[/TD]
[TD="align: center"]13[/TD]
[TD="align: center"]14[/TD]
[TD="align: center"]15[/TD]
[TD="align: center"]16[/TD]
[TD="align: center"]17[/TD]
[TD="align: center"]18[/TD]
[TD="align: center"]19[/TD]
[TD="align: center"]20[/TD]
[TD="align: center"]21[/TD]
</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