Forum Discussion

LeeBrennan's avatar
LeeBrennan
Copper Contributor
Mar 22, 2022

Combining data when removing duplicates

Morning forum, 

 

I'm looking for some help with removing duplicates in excel, I'd like to know if there is a way to sum total particular fields of data as duplicates are removed? 

 

For example, I'd like the sum of the contents of Column B when removing duplicates displayed in column A.

 

Turning this....

AB
315060900008751.75
315060900008751.75
315060900008751.75
315060900008772.81
315060900008772.81
315060900008772.81

 

Into this....

AB
315060900008755.25
315060900008778.43

 

Any help or advice would be most appreciated 🙂 

7 Replies

  • Harun24HR's avatar
    Harun24HR
    Bronze Contributor

    Another approach using GROUPBY() and trimrange feature referencing full column.

    =GROUPBY(DROP(B.:.B,1),DROP(C.:.C,1),SUM,,0)
    =GROUPBY(B2.:.B12,C2.:.C12,SUM,,0)

     

  • LeeBrennan 

    Modern Excel has so many alternatives and, as yet, little guidance concerning best practice. 

    = SUMIFS(value,ref,UNIQUE(ref))

    but a whole spectrum of variations is possible, including,

    = MAP(UNIQUE(ref), Sumifλ(value,ref))
    
    where "Sumifλ" is given by
    = LAMBDA(v₀,r₀, LAMBDA(d, SUM(FILTER(v₀, r₀=d))))

     The purpose of the two Lambdas is to allow the sum and criterion ranges to be passed as a parameter string whilst each unique ref is passed one at a time by the MAP helper function.

    • Isadora94's avatar
      Isadora94
      Copper Contributor

      Hi! How are you?

      I need the exact same thing, but instead of numbers there's only text.

      The file has over 120 k lines and thousands of duplicates. The column A has the ID for some genetic mutations, column B has the specific trait for that mutation and column C has the bigger trait. So I have duplicates for the ID's and traits, and I would like to remove the ID duplicates, but combining the data related to it, all in one line. 

      Do you think you can help me?

Resources