# Group related fields together

1. ## Group related fields together

Hey guys,

my biggest problem is that I dont know how to discribe what I want... otherwise I could goolge it easily...
I got a list with 100+ names and cities and i want to collect who is living in the same city.

Here an example:

Name City living in the same City
Hans München
Peter Berlin Stefan,Michael
Ben Hamburg Nadine
Nadine Hamburg Ben
Stefan Berlin Peter,Michael
Michael Berlin Stefan,Peter

Hans is the only one coming from München so the field is blank because I dont want to list its own name.
Peter is living in Berlin as well as Stefan and Michael. Therefore it says "Stefan,Michael".

Is there a function to do the third column? Important is that the names are seperated with a comma.

Thanks in advance!
stinkzor

2. ## Re: Group related fields together

Hi,
please upload your sample clause in excel, it's hard to tell how your columns are divided.

See the yellow banner at the top of the page for more instructions.

3. ## Re: Group related fields together

Hey Belinda200,

thanks for your fast reply. Please find attached my sample.xlsx.

Best regards
stinkzor

4. ## Re: Group related fields together

Being on version 2022 I assume you have access to the FILTER formula. If so, in C2 try this:

=TEXTJOIN(", ",TRUE,TRANSPOSE(FILTER(\$A\$2:\$A\$7,(\$B\$2:\$B\$7=B2)*(\$A\$2:\$A\$7<>A2),"")))

and copy down.

5. ## Re: Group related fields together

Originally Posted by Gregb11
Being on version 2022 I assume you have access to the FILTER formula. If so, in C2 try this:

=TEXTJOIN(", ",TRUE,TRANSPOSE(FILTER(\$A\$2:\$A\$7,(\$B\$2:\$B\$7=B2)*(\$A\$2:\$A\$7<>A2),"")))

and copy down.
ty for your help!
I tryed your function but I get some errors (maybe because I got an german excel verstion) so I had to adjust it a little bit:
=TEXTKETTE(", ";WAHR;MTRANS(FILTER(\$A\$2:\$A\$7;(\$B\$2:\$B\$7=B2)*(\$A\$2:\$A\$7<>A2);"")))

Basically it works, but there is only a comma at the beginning of the cell and the word "true". Can this still be adjusted?

Thanks!

6. ## Re: Group related fields together

When I open your file, it has the CONCAT. Your version (if you're on Version 2022) you should have the TEXTJOIN formula available - it came out in V2019. I've attached the file. See if it works for you when you open it.

7. ## Re: Group related fields together

Administrative Note:

Members will tailor the solutions they offer to the version (NOT release number like 2022) of Office (Excel) that you have. Please check that your forum profile is up-to-date in this respect. If you aren't sure, in Excel go to File | Account and report what it says below the MS logo at the top of that page. If your version is for Mac, please also state this. Thanks.

8. ## Re: Group related fields together

In German:

=TEXTVERKETTEN(", ";WAHR;MTRANS(FILTER(\$A\$2:\$A\$7;(\$B\$2:\$B\$7=B2)*(\$A\$2:\$A\$7<>A2);"")))

9. ## Re: Group related fields together

Gregb11: tyvm! You saved me a lot of time!

AliGW: You are right, I corrected it to Office 2021.

Thanks
stinkzor

#### Thread Information

##### Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1