Hi there.
Long-time Excel user and dabbler in VBA and Power Query.
I've got a variation on a problem I posted a few years ago in this thread.
There, folks helped me use PowerQuery to collapse data, combining multiple rows into single, multi-value cells while removing duplicates. The wrinkle now is how to accomplish that across multiple columns and sort the contents.
An example should be helpful. Here's a mock-up of my source data:
BAND | MEMBER | INSTRUMENT
Beatles | John | Guitar
Beatles | Paul | Bass
Beatles | George | Guitar
Beatles | Ringo | Drums
Beatles | Stuart | Bass
Beatles | John | Guitar
Beatles | Pete | Drums
Stones | Mick | Vocals
Stones | Keith | Guitar
Stones | Charlie | Drums
Stones | Ronnie | Guitar
Stones | Mick | Vocals
Stones | Brian | Guitar
Stones | Bill | Bass
Stones | Mick | Guitar
Band name in Col A; Band Member in Col B; Instrument in Col C. Note that we have duplicates in both columns B and C, which I've bolded.
I've used Power Query to roll this stuff up nicely, with the result a single row per value in Column A. However, my current results looks like this:
BAND | MEMBER | INSTRUMENT
Beatles | John;Paul;George;Ringo;Stuart;John;Pete | Guitar;Bass;Guitar;Drums;Bass;Guitar;Drums
Stones | Mick;Keith;Charlie;Ronnie;Mick;Brian;Bill;Mick | Vocals;Guitar;Drums;Guitar;Vocals;Guitar;Bass;Guitar
Columns B and C contain multi-value field/cells, with individual values separated by semicolons. Again, duplicate values bolded.
The issue is the duplicates. It's important to note that my duplicates are within single, multi-value cells. So the question is how to use Power Query to do the following:
1) Clean those cells and remove any duplicative values in each individual cell.
2) Sort the individual values alpha-numerically
My goal is to get to this result:
BAND | NAME | INSTRUMENT
Beatles | George;John;Paul;Pete;Ringo;Stuart | Bass;Drums;Guitar
Stones | Bill;Brian;Charlie;Keith;Mick;Ronnie | Bass;Drums;Guitar;Vocals
Any input welcome.
Thanks!
Long-time Excel user and dabbler in VBA and Power Query.
I've got a variation on a problem I posted a few years ago in this thread.
There, folks helped me use PowerQuery to collapse data, combining multiple rows into single, multi-value cells while removing duplicates. The wrinkle now is how to accomplish that across multiple columns and sort the contents.
An example should be helpful. Here's a mock-up of my source data:
BAND | MEMBER | INSTRUMENT
Beatles | John | Guitar
Beatles | Paul | Bass
Beatles | George | Guitar
Beatles | Ringo | Drums
Beatles | Stuart | Bass
Beatles | John | Guitar
Beatles | Pete | Drums
Stones | Mick | Vocals
Stones | Keith | Guitar
Stones | Charlie | Drums
Stones | Ronnie | Guitar
Stones | Mick | Vocals
Stones | Brian | Guitar
Stones | Bill | Bass
Stones | Mick | Guitar
Band name in Col A; Band Member in Col B; Instrument in Col C. Note that we have duplicates in both columns B and C, which I've bolded.
I've used Power Query to roll this stuff up nicely, with the result a single row per value in Column A. However, my current results looks like this:
BAND | MEMBER | INSTRUMENT
Beatles | John;Paul;George;Ringo;Stuart;John;Pete | Guitar;Bass;Guitar;Drums;Bass;Guitar;Drums
Stones | Mick;Keith;Charlie;Ronnie;Mick;Brian;Bill;Mick | Vocals;Guitar;Drums;Guitar;Vocals;Guitar;Bass;Guitar
Columns B and C contain multi-value field/cells, with individual values separated by semicolons. Again, duplicate values bolded.
The issue is the duplicates. It's important to note that my duplicates are within single, multi-value cells. So the question is how to use Power Query to do the following:
1) Clean those cells and remove any duplicative values in each individual cell.
2) Sort the individual values alpha-numerically
My goal is to get to this result:
BAND | NAME | INSTRUMENT
Beatles | George;John;Paul;Pete;Ringo;Stuart | Bass;Drums;Guitar
Stones | Bill;Brian;Charlie;Keith;Mick;Ronnie | Bass;Drums;Guitar;Vocals
Any input welcome.
Thanks!