+ Reply to Thread
Results 1 to 6 of 6

How do I add the values of duplicates together in a separate column?

  1. #1
    Registered User
    Join Date
    03-24-2008
    Posts
    14

    How do I add the values of duplicates together in a separate column?

    I would be very grateful if somebody could help me out with this.

    Column A has a list of items where some items occur more than once, and column B has a value for each item.

    I want column C to show the same information as column B, except add the values for the duplicates in column A together, like so:

    A. B. C
    a 10 25
    b 10 10
    a 15 25
    c 10 10
    d 10 10

  2. #2
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Hi,

    Try this in C1 and copy down

    =SUMPRODUCT(--($A$1:$A$100=A1)*(--(B$1:$B$100)))
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  3. #3
    Registered User
    Join Date
    03-24-2008
    Posts
    14
    Works like a charm! Thank you!

  4. #4
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243
    hi,

    An alternative is to copy the below down in column C as needed:
    =SUMIF($A$1:$A$100,$A1,$B1:$B$100)

    OldChippy, I was just just wandering through the day's posts & when I spotted this one I became curious... is there an advantage to using Sumproduct over Sumif in this case?

    Rob
    Rob Brockett
    Kiwi in the UK
    Always learning & the best way to learn is to experience...

  5. #5
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    ... is there an advantage to using Sumproduct over Sumif in this case?
    Hi,

    It was just the first solution that came into my head when I read the question Can't think of any reason why one is better than the other.

  6. #6
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243
    ahhh, yep that makes sense - I have a few of those solutions at work where it is "6 of one, 1/2 a dozen of the other".

    Rob

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1