Comma Separated Array List

JHusk

New Member
Joined
Dec 7, 2022
Messages
32
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
I've just hit a wall here and my brain refuses to bring this information up.

I have a cell with a series of room names in it, separated by commas: Master Bedroom, Master Bathroom, Laundry Room, Stairs, etc. Call this A1

In "D1" I'd like to place a formula that will take those room names and put them in a dynamic list in D1, D2, D3, D4 D5, etc. Basically creating any array of all everything between the commas.

Thanks in advance...
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Since you have O365 you have power query which is called Get and Transform Data and found on the Data Tab

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(Source, {{"Column1", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Column1"),
    #"Trimmed Text" = Table.TransformColumns(#"Split Column by Delimiter",{{"Column1", Text.Trim, type text}})
in
    #"Trimmed Text"

Book10
ABCD
1Column1Column1
2Master Bedroom, Master Bathroom, Laundry Room, Stairs, etcMaster Bedroom
3Master Bathroom
4Laundry Room
5Stairs
6etc
Sheet2
 
Upvote 0
ToCol.xlsm
ABCD
1Master Bedroom,Master Bathroom,Laundry Room,StairsMaster Bedroom
2Master Bathroom
3Laundry Room
4Stairs
5
6
1d
Cell Formulas
RangeFormula
D1:D4D1=TEXTSPLIT(A1,,",")
Dynamic array formulas.
 
Upvote 0
Solution
Another option if you don't have textsplit yet.
Excel Formula:
=FILTERXML("<k><m>"&SUBSTITUTE(A1,",","</m><m>")&"</m></k>","//m")
 
Upvote 0
@Dave Patton here's a interesting addition to this (what resulted in a very simply solution lol), what If I wanted to limit it to 15 items between the commas?

Say I have a cell with 25 room names in it, all room separated by commas. but I only want the first 15. Would something like the MAX function work?
 
Upvote 0
As you have textsplit, you also have take, so how about
Excel Formula:
=TAKE(TEXTSPLIT(A1,,","),15)
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,814
Messages
6,181,124
Members
453,021
Latest member
Justyna P

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