Group label to Row label

Rumble

New Member
Joined
May 20, 2011
Messages
2
Help!
My goal is to create a script or macro to take the "Group" type and add it as a column to the left -- see example below. In these examples I could then sort by Color to demonstrate the flexibility in the data. NOTE: there can be more "Groups", it is not just limited to 2 as shown in this example however the blank lines and format is consistent throughout.

Thoughts on the best approach to iterate/associate the Group name by row instead? The "." is used to assist with this posting to ensure my column/row examples line up...

Column A is blank here...
.....A......B......C......D...... E
1. ...... BLUE
2. .......Ball
3. .......Pale
4. .......Book
5. .................
6. .......Number Blue=3
7. ..................
8. .......RED
9. .......Sign
10. ......Cup
11. ......Door
12. ......Car
13. ......Poster
14. ....................
15. ..... Number Red=5

To now have my data have a 1-to-1 association and remove the grouping to perform pivots and other preferred ways to use the data, the final output would look like this essentially removing the grouping and label each row with the previous group value:

Column A would then become the Group Value
.....A......B......C......D.....E
1. BLUE....Ball
2. BLUE....Pale
3. BLUE....Book
4. RED.....Sign
5. RED.....Cup
6. RED.....Door
7. RED.....Car
8. RED.....Poster
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,399
Latest member
alchavar

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