+ Reply to Thread
Results 1 to 7 of 7

Remove duplicate values based on a date criteria

  1. #1
    Registered User
    Join Date
    11-03-2012
    Location
    Montreal, Canada
    MS-Off Ver
    Excel 2007
    Posts
    32

    Remove duplicate values based on a date criteria

    Hi,

    I have a database of +2000 rows on a sheet that contain duplicated value on column "A". that I would like to delete based on the most recent date on collumn "H". (see the example file in attachment)

    Thanks for your help!

    Simon
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Re: Remove duplicate values based on a date criteria

    you could use a max(if(...)) array function to mark all the lines that need to be deleted, then sort by those and then delete them. Other than this i would think the only way to do this is via a macro. I am not able to look at your attachment at the moment on my computer, so i will give you what you would need for a formula in Cell "I2"

    Put this in I2 or wherever your data starts:

    =IF(MAX(IF(A2:A2000=A2,H2:H2000))=H2,0,1) 'Modify this formula as needed

    To enter this formula hold Ctrl+Shift and press enter then copy the formula down and filter and delete as needed. HTH
    Regards,
    amotto

    If I helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Remove duplicate values based on a date criteria

    Filter on the green cells, and delete these values if the tekst is "delete".

    See the attached file.
    Attached Files Attached Files
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Registered User
    Join Date
    11-03-2012
    Location
    Montreal, Canada
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: Remove duplicate values based on a date criteria

    Hi,

    Your solution partially works on collumn `L`, it identify the most recent date. The problem is that it works only for the values that are duplicate more than 2 times. It doesn't work for the one that are duplicate 2 times.

    Thanks for your help,

  5. #5
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516
    It should work for all of them, I believe. If you have one number it is the maximum. If you have two there still has to be a maximum, and three and so on. You will need to lock down, olace dollar signs, on the h values and the a values not including a2. Did you do this? I forgot it in my formula. That is probably the prpblen

  6. #6
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516
    Here is the new formula remember to enter as an array

    =IF(MAX(IF($A$2:$A$2000=A2,$H$2:$H$2000))=H2,0,1) 'Modify this formula as needed

    I think it didn't work because the values weren't locked dowb

  7. #7
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Remove duplicate values based on a date criteria

    @nomiss6565

    and what about my soluition in #3.

+ 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