+ Reply to Thread
Results 1 to 5 of 5

Thread: Merging duplicate rows, but summing a particular column.

  1. #1
    Registered User
    Join Date
    06-24-2011
    Location
    Philadelphia, USA
    MS-Off Ver
    Excel 2003
    Posts
    8

    Question Merging duplicate rows, but summing a particular column.

    Hi everyone!
    I have spent the last hour trying to find a solution to my problem, and I just cannot find one that works, but I know it is out there.
    I currently have an excel spreadsheet with roughly 10000 rows and about 10 columns.
    There are duplicate rows, and every column has the identical value with the exception of the "amount" column.
    I need to merge these duplicates, but add the values in the "amount" column.

    My spreadsheet looks like this:
    Company | Street | City | State | Amount
    John, Inc. | 125 Marshall Street | Philadelphia | PA | 125.00
    John, Inc. | 125 Marshall Street | Philadelphia | PA | 65.00
    John, Inc. | 125 Marshall Street | Philadelphia | PA | 130.00
    Mike's Co. | 5349 9th Street | Exton | PA | 45.00
    Mike's Co. | 5349 9th Street | Exton | PA | 66.00


    I want it to look like this:
    Company | Street | City | State | Amount
    John, Inc. | 125 Marshall Street | Philadelphia | PA | 320.00
    Mike's Co. | 5349 9th Street | Exton | PA | 111.00

    I tried pivot tables, and I cannot figure it out.
    Please, any advice or solutions would be GREATLY appreciated. '

    Thanks,
    Jon

  2. #2
    Forum Guru davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2007
    Posts
    1,879

    Re: Merging duplicate rows, but summing a particular column.

    Use an advanced filter to get a column that has the unique Company names. Then use a vlookup to fill the street, city, and state columns, and use a sumif to fill the total amount column.

    If you need more help, post a sample workbook and I'll set it up for you.
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  3. #3
    Registered User
    Join Date
    06-24-2011
    Location
    Philadelphia, USA
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Merging duplicate rows, but summing a particular column.

    Hi Dave,
    Thank you so much for offering your help.

    I understand about using an advanced filter, but it still seems to give me duplicates of the company. I think this may be because each entry has a separate date (which I do not care about, I could use the most recent date per company). I am not educated on what a vlookup is or how to set it up properly.

    I have posted a sample workbook. If you are able to take time to set it up, I would greatly appreciate it. If not, thank you so much for the advice you have already given me, and I will try to learn more about vlookups.

    Thanks again,
    Jon
    Attached Files Attached Files

  4. #4
    Forum Guru davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2007
    Posts
    1,879

    Re: Merging duplicate rows, but summing a particular column.

    New table set up in N4:V4.
    I got column N using an advanced filter on column A only, then used vlookups, as you will see, for other relevant fields. I got the sums in column V with the SUMIF function.
    Attached Files Attached Files
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  5. #5
    Registered User
    Join Date
    06-24-2011
    Location
    Philadelphia, USA
    MS-Off Ver
    Excel 2003
    Posts
    8

    Talking Re: Merging duplicate rows, but summing a particular column.

    Dave,
    This is amazing work. Thank you VERY much for your help with this.
    I am studying the spreadsheet now to learn more about Vlookups so I can recreate this in the future.
    You saved me many more hours of frustration...I really appreciate it.

    Thanks,
    Jon

+ 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.2.0