Search code examples
google-sheetsgoogle-sheets-formulatransposearray-formulas

Combine duplicate rows, merge and sum values


I need to combine duplicate rows then concatenate values in column 2 and sum values in column 3, if row does not have duplicate retain values. I'm using Excel 2010.

Given;

Col1                 Col2          Col3    
Apple                Red           2   
Apple                Green         5   
24829                sk1           2   
24829                sd2           8    
123                  po3           1  
Bag                  black         7

Expected Output:

Col1                   Col2                   Col3    
Apple                  Red,Green              7    
24829                  sk1,sd2                10    
123                    po3                    1    
Bag                    black                  7

Solution

  • With Google Sheets you could try:

    Col G:=unique(A2:A)

    Col H:=join(",",filter(B2:B,A2:A=G2))

    Col I:=sumif(A2:A,G2,C2:C)

    enter image description here