IAmLemondrop
New Member
- Joined
- Feb 19, 2013
- Messages
- 13
I'm working with a dataset with a strange formatting. It looks like:
Column A
Category 1
Item 1
Item 2
Item 3
Category 1 Total
Category 2
Item 4
Item 5
Item 6
Category 2 Total
Instead of utilizing different columns, all of the above in in one column (with the sub items indented with 5 spaces). I'd like to break out the Category titles and put them in the column next to their corresponding item.
So I'm looking for a macro (or a formula), that will give me:
Column A Column B
Category 1 Item 1
Category 1 Item 2
Category 2 Item 4...
Any ideas? My immediate thoughts were to create a new column to find the total row and copy it over with an =IF(ISERR(SEARCH("*total*",B5)),"",B5). But I'm stumped on how to automate bringing out the category headers, filling down until the "Total" is reached and restarting the process at the next category header.
Column A
Category 1
Item 1
Item 2
Item 3
Category 1 Total
Category 2
Item 4
Item 5
Item 6
Category 2 Total
Instead of utilizing different columns, all of the above in in one column (with the sub items indented with 5 spaces). I'd like to break out the Category titles and put them in the column next to their corresponding item.
So I'm looking for a macro (or a formula), that will give me:
Column A Column B
Category 1 Item 1
Category 1 Item 2
Category 2 Item 4...
Any ideas? My immediate thoughts were to create a new column to find the total row and copy it over with an =IF(ISERR(SEARCH("*total*",B5)),"",B5). But I'm stumped on how to automate bringing out the category headers, filling down until the "Total" is reached and restarting the process at the next category header.