Forum Discussion

Method_Coffee's avatar
Method_Coffee
Copper Contributor
Jul 15, 2022

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?

  • Method_Coffee 

    =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.

     

  • Method_Coffee 

    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)

Resources