Filtering text data based on unique names and then pasting all the data into one single cell for each name

p49

New Member
Joined
Oct 10, 2024
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hi all, excel noob here trying to learn but I have spent an insane amount of time on this problem without going anywhere. I made this mockup with the 2nd picture being the desired result, you can ignore the contents in the Adress field. The goal is to assign companies and the stores under them to each unique name and then remove the duplicate name rows. Basically copying and consolidating info from the duplicate rows into a cell of the first instance of a name. I have tried using pivot tables but that doesn't work because of these all being text fields. Filtering using UNIQUE also doesn't seem to work. At this point I'm considering trying to process the data in sql, maybe I'll have better luck there. I just want to know how to achieve this desired result :cry:. Thank you in advance.
Screenshot 2024-10-10 155948.png
Screenshot 2024-10-10 155415.png
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Hi and welcome to MrExcel

For example in cel H2 put the following formula:
Excel Formula:
=LET(a,UNIQUE(D2:E8),d,D2:D8,e,E2:E8,VSTACK(
BYROW(a,LAMBDA(br,TEXTJOIN(CHAR(10),1,FILTER(A2:B8,(d=CHOOSECOLS(br,1))*(e=CHOOSECOLS(br,2)))))),
BYROW(a,LAMBDA(br,INDEX(C2:C8,MATCH(1,(d=CHOOSECOLS(br,1))*(e=CHOOSECOLS(br,2)),0)))),a))

🤗
 
  • Like
Reactions: p49
Upvote 0
Solution
@DanteAmor's solution is no doubt perfect as always, I just wanted to test the newly released GROUPBY function:

Excel Formula:
=CHOOSECOLS(SUBSTITUTE(GROUPBY(C2:E8,A2:A8&"; "&B2:B8,ARRAYTOTEXT,,0),"; ",CHAR(10)),4,1,2,3)
 
Upvote 0
Hi and welcome to MrExcel

For example in cel H2 put the following formula:
Excel Formula:
=LET(a,UNIQUE(D2:E8),d,D2:D8,e,E2:E8,VSTACK(
BYROW(a,LAMBDA(br,TEXTJOIN(CHAR(10),1,FILTER(A2:B8,(d=CHOOSECOLS(br,1))*(e=CHOOSECOLS(br,2)))))),
BYROW(a,LAMBDA(br,INDEX(C2:C8,MATCH(1,(d=CHOOSECOLS(br,1))*(e=CHOOSECOLS(br,2)),0)))),a))

🤗
You’re amazing! Thank you so much oh great excel wizard! 😭😭
 
Upvote 0
@DanteAmor's solution is no doubt perfect as always, I just wanted to test the newly released GROUPBY function:

Excel Formula:
=CHOOSECOLS(SUBSTITUTE(GROUPBY(C2:E8,A2:A8&"; "&B2:B8,ARRAYTOTEXT,,0),"; ",CHAR(10)),4,1,2,3)
Thank you! I’ll have a look at this one too. 🙂
 
Upvote 0

Forum statistics

Threads
1,222,902
Messages
6,168,938
Members
452,227
Latest member
sam1121

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