+ Reply to Thread
Results 1 to 9 of 9

Deleting rows based on duplicates in one column only

  1. #1
    Registered User
    Join Date
    09-26-2012
    Location
    Oxford, England
    MS-Off Ver
    Excel 2007
    Posts
    10

    Deleting rows based on duplicates in one column only

    Not sure if that explains it.

    I have multiple entries for each Id no (column AL) and I want to identify and remove all duplicates. Even though there are some variants as you go across the row, it doesn't matter if the whole row gets deleted (I don't need to merge the rows). In the example attached, I should end up with four rows. Is there a simple(ish) way of doing this? Please bear in mind, I can cut and paste like a genius but have little understanding of why all these fixes work!

    Thanks

    K
    Attached Files Attached Files
    Last edited by KD70; 10-12-2012 at 11:27 AM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Deleting rows based on duplicates in one column only

    In AM2 dragged down
    =COUNTIF($AL$2:AL2, AL2)
    This counts how many times each value in AL appears (as they appear)
    Then autofilter on Column AM any value greater than 1 and delete those rows
    Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Deleting rows based on duplicates in one column only

    If you have 2007 or greater Excel has a built in remove dupes. Check out this link

    http://blog.contextures.com/archives...in-excel-2007/
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Deleting rows based on duplicates in one column only

    Sheesh, I didn't even think of that Mike. Nice call.

  5. #5
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Deleting rows based on duplicates in one column only

    Thanks B, Sometimes I have a plan.

  6. #6
    Registered User
    Join Date
    05-25-2012
    Location
    Chennai,TamilNadu,India
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    61

    Cool Re: Deleting rows based on duplicates in one column only

    Hi,

    Remove duplicates would not work in this case to remove the duplicates because your subject column has different entries for the same ID which wont let you to remove the duplicates.

    Please find attached the solution file, i developed a small macro which will take care of this problem for you. When you open this file, enable the macro and click on the button provided in the file.

    Hope this helps...

    If you are happy with the solution, click on the left hand bottom corner "star" icon.

    Thanks,
    Hariharan
    Attached Files Attached Files

  7. #7
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Deleting rows based on duplicates in one column only

    @reachharry

    Have you even tried the Built in excel remove dupes function? If so and you did not get the correct results, then follow these steps.

    0. Click on remove dupes
    1. Unselect all
    2. Select the last row in the Listbox.
    3 Click remove dupes.

    Works for me
    Last edited by mike7952; 10-12-2012 at 01:06 PM.

  8. #8
    Registered User
    Join Date
    05-25-2012
    Location
    Chennai,TamilNadu,India
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    61

    Re: Deleting rows based on duplicates in one column only

    Hey Mike,

    Sorry I have not tried doing that, i tried it right now, it works now..

    Thanks for the input...good learning..

  9. #9
    Registered User
    Join Date
    09-26-2012
    Location
    Oxford, England
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Deleting rows based on duplicates in one column only

    Thanks guys. I tried both (I'm using 2007) and they both worked! Will put that into full swing when I go back to work next week

+ 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