Sum the values in one column associated with the unique ID in another column. and concatenate the data

sontho

New Member
Joined
May 16, 2023
Messages
8
Office Version
  1. 365
Platform
  1. Windows
I come from Vietnam . I am having over 100k data. But my data has duplicate phone numbers. But the data related to these duplicate phone numbers is different and inconsistent.

Thanks for everyone's help according to the desired result in excel

Thank you very much
1684248480246.png
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Apologize for the ABOVE RESULTS I WAS WRONG. The EXACT RESULTS WILL BE



1684248638435.png
 
Upvote 0
Welcome to the MrExcel board!

See if this is any use.

BTW, I suggest that you investigate XL2BB for providing sample data to make it easier for helpers by not having to manually type out sample data to test with.

23 05 17.xlsm
ABCDEFG
1PhoneNameJobaddresssexrevenuereal mone
2854857858JohnBeauticianEnglandfemale10050
3415245215BSwedenmale200100
4854857858KSwedenmale300200
5415245215CBeauticianEnglandfemale400200
6854569856DBarberSwedenfemale500300
7854857858KAstronautEnglandfemale600200
8854857858JohnBeauticianEnglandfemale700300
9
10
11PhoneNameJobaddresssexrevenuereal mone
12854857858John K K JohnBeauticianEnglandfemale1700750
13415245215B CBeauticianSwedenmale600300
14854569856DBarberSwedenfemale500300
sontho
Cell Formulas
RangeFormula
A12:A14A12=UNIQUE(A2:A8)
B12:B14B12=TEXTJOIN(" ",1,FILTER(B$2:B$8,A$2:A$8=A12,""))
C12:E14C12=INDEX(FILTER(C$2:C$8,($A$2:$A$8=$A12)*(C$2:C$8<>""),""),1)
F12:G14F12=SUMIF($A$2:$A$8,$A12,F$2:F$8)
Dynamic array formulas.
 
Upvote 0
Welcome to the MrExcel board!

See if this is any use.

BTW, I suggest that you investigate XL2BB for providing sample data to make it easier for helpers by not having to manually type out sample data to test with.

23 05 17.xlsm
ABCDEFG
1PhoneNameJobaddresssexrevenuereal mone
2854857858JohnBeauticianEnglandfemale10050
3415245215BSwedenmale200100
4854857858KSwedenmale300200
5415245215CBeauticianEnglandfemale400200
6854569856DBarberSwedenfemale500300
7854857858KAstronautEnglandfemale600200
8854857858JohnBeauticianEnglandfemale700300
9
10
11PhoneNameJobaddresssexrevenuereal mone
12854857858John K K JohnBeauticianEnglandfemale1700750
13415245215B CBeauticianSwedenmale600300
14854569856DBarberSwedenfemale500300
sontho
Cell Formulas
RangeFormula
A12:A14A12=UNIQUE(A2:A8)
B12:B14B12=TEXTJOIN(" ",1,FILTER(B$2:B$8,A$2:A$8=A12,""))
C12:E14C12=INDEX(FILTER(C$2:C$8,($A$2:$A$8=$A12)*(C$2:C$8<>""),""),1)
F12:G14F12=SUMIF($A$2:$A$8,$A12,F$2:F$8)
Dynamic array formulas.
Thanks you very much .
Please help me optimize the above formula. My data is 800,000 lines when I try to run =TEXTJOIN(" ",1,FILTER(B$2:B$8,A$2:A$8=A12,"")) excel is not responsive
 
Upvote 0
when I try to run =TEXTJOIN(" ",1,FILTER(B$2:B$8,A$2:A$8=A12,"")) excel is not responsive
Presumably that is not what you actually ran, but rather with your large range?

I don't know of a formula that will do what you want in the Name column any more efficiently. A macro could do what you want though, would that be acceptable?
If so, about how many unique phone numbers would you expect to have in your 800,000 rows?
 
Upvote 0
Presumably that is not what you actually ran, but rather with your large range?

I don't know of a formula that will do what you want in the Name column any more efficiently. A macro could do what you want though, would that be acceptable?
If so, about how many unique phone numbers would you expect to have in your 800,000 rows?
exactly i have 851,830 lines. After using Unique, the data is 842,657
 
Upvote 0

Forum statistics

Threads
1,216,122
Messages
6,128,964
Members
449,480
Latest member
yesitisasport

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