Comma separated to columnar

tigerzen

Board Regular
Joined
Mar 8, 2023
Messages
165
Office Version
  1. 365
Platform
  1. Windows
Thought this would be easier but need to present data in columns as per this example. Really looking for the simplest way possible to do this so if there are any commands like Find and Replace that would do it, great, otherwise formulae/function and if that is not possible then VBA.
Crtieria map updated.xlsb.xlsx
ABCDEFG
1Required output
2HRSalesAdminHRSalesAdmin
3Tom, FredSally, Ken, PeterVictor, Steve, Noel, AdamTomSallyVictor
4FredKenSteve
5PeterNoel
6Adam
Sheet3
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
With Power Query

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(Source, {}, "Attribute", "Value"),
    #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(#"Unpivoted Columns", {{"Value", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Value"),
    #"Trimmed Text" = Table.TransformColumns(#"Split Column by Delimiter",{{"Value", Text.Trim, type text}}),
    #"Grouped Rows" = Table.Group(#"Trimmed Text", {"Attribute"}, {{"Data", each _, type table [Attribute=text, Value=text]}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Custom", each Table.AddIndexColumn([Data],"Index",1,1)),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Data"}),
    #"Expanded Custom" = Table.ExpandTableColumn(#"Removed Columns", "Custom", {"Value", "Index"}, {"Custom.Value", "Custom.Index"}),
    #"Pivoted Column" = Table.Pivot(#"Expanded Custom", List.Distinct(#"Expanded Custom"[Attribute]), "Attribute", "Custom.Value"),
    #"Removed Columns1" = Table.RemoveColumns(#"Pivoted Column",{"Custom.Index"})
in
    #"Removed Columns1"

Book4
ABCDEFG
3HRSalesAdminHRSalesAdmin
4Tom, FredSally, Ken, PeterVictor, Steve, Noel, AdamTomSallyVictor
5FredKenSteve
6PeterNoel
7Adam
Sheet1
 
Upvote 0
Like this?
BTW, if you happen to not have the TEXTSPLIT function yet, an alternative formula is not too much longer.

23 06 07.xlsm
ABCDEFG
1HRSalesAdminHRSalesAdmin
2Tom, FredSally, Ken, PeterVictor, Steve, Noel, AdamTomSallyVictor
3FredKenSteve
4PeterNoel
5Adam
Columns (2)
Cell Formulas
RangeFormula
E2:E3,G2:G5,F2:F4E2=FILTERXML("<p><c>"&SUBSTITUTE(A2,", ","</c><c>")&"</c></p>","//c")
Dynamic array formulas.
 
Upvote 0
Like this?

23 06 07.xlsm
ABCDEFG
1HRSalesAdminHRSalesAdmin
2Tom, FredSally, Ken, PeterVictor, Steve, Noel, AdamTomSallyVictor
3FredKenSteve
4PeterNoel
5Adam
6
Columns
Cell Formulas
RangeFormula
E2:E3,G2:G5,F2:F4E2=TEXTSPLIT(A2,,", ")
Dynamic array formulas.
That is beautiful, can't ask for more than that.
 
Upvote 0
Cheers. Glad it worked for you. I agree that it can't get much simpler. :)
 
Upvote 0

Forum statistics

Threads
1,215,077
Messages
6,122,991
Members
449,094
Latest member
masterms

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