Forum Discussion
Method_Coffee
Jul 15, 2022Copper Contributor
Merge cells with same value
Hello,
I am trying to merge cells with same value.
I have got data like this
A....5
A....3
B...2
B....3
C...1
and I want to get
A...8
B...5
C...1
Can you please help?
- OliverScheurichGold Contributor
=LEFT(A1,1)&"…"&SUMPRODUCT((LEFT($A$1:$A$5,1)=LEFT(A1,1))*RIGHT($A$1:$A$5,1))
An alternative could be this formula. Then copy the result of the formula and paste only values into range D1:D5. Then apply data -> remove duplicates.
- Riny_van_EekelenPlatinum Contributor
Perhaps a Pivot Table will do that, provided that the data is similar to what you can see in the attached file.
One option would be to create a pivot table based on the data.
Another option: let's say the data are in A1:B5.
In D1, enter the formula =UNIQUE(A1:A5)
In E1, enter the formula =SUMIF(A1:A5,D1#,B1:B5)