Delimiting a concatenated multi-column, multi-row output (TEXTJOIN + FILTER + INDEX + SEQUENCE)

AOB

Well-known Member
Joined
Dec 15, 2010
Messages
671
Office Version
  1. 365
  2. 2016
  3. 2013
Platform
  1. Windows
I have a multi-column table listing (among other things) names and associated groups, á la :

GroupSomeField1SomeField2SomeField3First NameLast NameSomeField4SomeFieldX
AfoobarfoobarHomerSimpsonfoobar
AfoobarfoobarFredFlintstonefoobar
BfoobarfoobarPeterGriffinfoobar
BfoobarfoobarDangerMousefoobar
BfoobarfoobarYogiBearfoobar

I'm trying to put together a formula that returns a concatenated list of names (i.e. multiple columns from multiple matches into a single delimited list of names)

I have this so far :

Excel Formula:
=TEXTJOIN(" ",TRUE,FILTER(INDEX(tblMyTable,SEQUENCE(ROWS(tblMyTable)),{5,6}),tblMyTable[Group]=GroupName))

But that (obviously) just delimits each first and last name with a space, á la :

GroupName = "A" : Homer Simpson Fred Flintstone
GroupName = "B" : Peter Griffin Danger Mouse Yogi Bear

I'd like to delimit each name "pair" (e.g. First Name + Last Name) with a comma (or some separating character) to achieve something like this :

GroupName = "A" : Homer Simpson, Fred Flintstone
GroupName = "B" : Peter Griffin, Danger Mouse, Yogi Bear

Any suggestions as to how I could modify my formula to delimit the output in this manner?

Thanks!
 
How about
Fluff.xlsm
ABCDEFGH
1GroupSomeField1SomeField2SomeField3First NameLast NameSomeField4SomeFieldX
2AfoobarfoobarHomerSimpsonfoobar
3AfoobarfoobarFredFlintstonefoobar
4BfoobarfoobarPeterGriffinfoobar
5BfoobarfoobarDangerMousefoobar
6BfoobarfoobarYogiBearfoobar
7
8
9
10AHomer Simpson, Fred Flintstone
11BPeter Griffin, Danger Mouse, Yogi Bear
Data
Cell Formulas
RangeFormula
B10:B11B10=TEXTJOIN({" ",", "},,FILTER(CHOOSECOLS(tblMyTable,5,6),tblMyTable[Group]=A10))
 
  • Like
Reactions: AOB
Upvote 0
Solution
Well that is pretty freaking awesome @Fluff thank you SO much - not only have you solved the problem, you've introduced me to CHOOSECOLS which I wasn't familiar with and, now, adore, and the formula is significantly simpler to read as well.

This is brilliant, thank you!
 
Upvote 0

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