+ Reply to Thread
Results 1 to 5 of 5

Deleting duplicate offsetting rows

  1. #1
    Registered User
    Join Date
    04-15-2008
    Posts
    3

    Deleting duplicate offsetting rows

    I think I have a problem that hasn't been discussed in any forums I've searched.

    I need to delete rows where all criteria are the same except the fees column are offsetting values; sum of 0. Example:

    Acct No. Name Date Provider Fees
    001 Dave 1/1/08 Fred 500
    001 Dave 1/1/08 Fred -500
    001 Dave 1/1/08 Fred 500
    002 Jeff 1/1/08 Fred 500
    003 Fran 1/7/08 Eric -250

    Either rows 1 and 2, or rows 2 and 3, need to be deleted. The negative value in this example is due to an erroneous charge being negated. Once the offsetting rows are deleted all negative values in the fees columns will need to be deleted, row 5. There are about 10,000 rows of data.
    After reading other posts it appears that the best approach is to start is at the last row and compare it to all of the data above it but I am at a loss as to how do do this. Any and all help is greatly appreciated.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Test this on a backup workbook

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    04-15-2008
    Posts
    3
    Hi royUK,
    Thank you for the response, however the macro only deletes the headers in the spreadsheet. Is there any additional information I can provide to clarify?

    Thanks again for your help!

  4. #4
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161
    bshbros, it seems that you want all duplicates deleting is that correct? or do you only want a row deleting that has a positive value in column D and then a negative value in column D for the same person?
    Not all forums are the same - seek and you shall find

  5. #5
    Registered User
    Join Date
    04-15-2008
    Posts
    3
    Hi Simon,
    If A,B,C and D are the same and the values in column E sum to 0, then both rows need to be deleted. Once that occurs, the remaining negative amounts would need to be deleted and finally, for cleanliness only, all rows with 0 on column E need to be deleted. I suppose if the rows with 0 in column E are deleted first there will be fewer rows to check.

    Thank you for your help.

+ 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