+ Reply to Thread
Results 1 to 7 of 7

Delete duplicates based on criteria

  1. #1
    Registered User
    Join Date
    11-28-2012
    Location
    Greece
    MS-Off Ver
    Excel 2010
    Posts
    44

    Delete duplicates based on criteria

    Hi to all once again
    I need your help once again
    Sorry that I cannot attached an xl example but through corporate condition the only I can do is to copy paste from xl (if I am out of forum condition please delete this post)
    I want to delete duplicates based on the following criteria.
    I want to delete the row that appears one or more times in contract number column and have the same reason. In this case I want to delete the row with newest entry date.
    In my example I want to delete only the first row

    Thanks again for your valuable help

    Entry date Customer's Last Nam Customer'sFirst Name Contract Number Contract reason
    9/8/2012 christos m 002600015007794423 5007794423 contract
    3/8/2012 christos m 002600015007794423 5007794423 contract
    3/8/2012 evelyn e 20 6901735240 question
    3/8/2012 peter p 21 6901735240 question
    4/8/2012 James J 15 6 question
    4/8/2012 James J 15 6 contract

  2. #2
    Forum Contributor
    Join Date
    11-07-2012
    Location
    .
    MS-Off Ver
    2003 - 2013 for Windows
    Posts
    121

    Re: Delete duplicates based on criteria

    Hello,

    make a backup copy of your file.

    Then go Data > Remove duplicates - specify the range that you want to check for duplicates.

    By default, Excel will keep the first item and remove any duplicates further down. You may want to sort your data ascending by entry date, so the newest entry date duplicate will be deleted.
    regards, LMP

  3. #3
    Registered User
    Join Date
    11-28-2012
    Location
    Greece
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Delete duplicates based on criteria

    thanks lmp for your answer!
    is it possible to have that in vba?

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Delete duplicates based on criteria

    id do it by in col F =B2&C2&D2&E2 in col g =IF(AND(COUNTIF($F$2:F2,F2)=1,COUNTIF($F$2:$F$10000,F2)>1),"delete","keep") filter on delete and delete
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Registered User
    Join Date
    11-28-2012
    Location
    Greece
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Delete duplicates based on criteria

    thanks martindwilson for your help. could you please give me an example in attached xl file

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Delete duplicates based on criteria

    its not vba tho
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    11-28-2012
    Location
    Greece
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Delete duplicates based on criteria

    thanks a lot both of you!
    martindwilson works perfect!!!

+ 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