Filtering Table into Multiple Columns

a68tbird

New Member
Joined
Nov 15, 2011
Messages
49
Office Version
  1. 365
Platform
  1. Windows
Hello All -
Here is my scenario. I have reports that show radio plays of songs based on an artist. Each report is specific to one artist, but has multiple levels of data that need to be separated out. The problem is that the data is all contained within two columns, with column 1 containing what should be multiple headers. Here is an example of the data:


Column1Column2
RegionPlays
North America72
Oceania2
CountryPlays
US69
Canada3
Australia2
SongPlays
Title 155
Title 219
ChannelActual
WGWG Radio13
KZE 98.16
KNWT 89.1 FM Wyoming Sounds4
KFMG 98.9 FM4
WRKC 88.5 FM3
WMOT Roots Radio 89.5 FM2
WPKN 89.5 FM2
WFHB 91.3 FM2
KOZT The Coast - Mendocino County's FM2
WRIU 90.3 FM1
WNCW NPR 88.7 FM1
Others34

So in this sample, Column 1 has four distinct areas that I'd like to separate: Region, Country, Song and Channel. I guess this would have to result in four new tables as there really isn't any way to flatten the info into one table. Also to note, each of those sections could have more or fewer entries - each downloaded report would have different values, but those headers remain constant.

Love to hear some ideas on how to accomplish this.

Thanks
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Table.Group could achive below result, each section in one table:
1625625524620.png
1625625537989.png
1625625546688.png


You can transform each table to the final layout you want to get and then combine them.
 
Upvote 0
Solution
for example, you can get below by expand table column:
1625626200076.png

Power Query:
= Table.ExpandTableColumn(Table.Group(Source,"Column1",{"n",each Table.Skip(_)},0,(x,y)=>Byte.From(List.Contains({"Region","Country","Song","Channel"},y))),"n",{"Column1","Column2"},{"Title1","Title2"})
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,956
Members
449,096
Latest member
Anshu121

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