+ Reply to Thread
Results 1 to 4 of 4

Thread: finding duplicates in a worksheet

  1. #1
    Registered User
    Join Date
    08-10-2009
    Location
    U.S.
    MS-Off Ver
    Excel 2003
    Posts
    12

    finding duplicates in a worksheet

    I have about 30,000 names in a worksheet and want to be able to search for duplicates. In the past, I have sorted my columns and done a simple IF formula comparing the cell prior. This works well trying to copy the formula down to all 30,000 cells is a little tedious.

    Thanks,
    seemore
    Last edited by seemore; 01-31-2011 at 01:16 PM.

  2. #2
    Forum Moderator Richard Buttrey's Avatar
    Join Date
    02-15-2008
    Location
    Grappenhall, UK
    MS-Off Ver
    Excel for Windows & Mac - all versions.
    Posts
    6,566

    Re: finding duplicates in a worksheet

    Hi,

    You don't need to sort your data. You could use an =COUNTIF($A1:$A30000,A1) and copy that down. Anything that returns > 1 is a duplicate. I don't see how you can avoid the copy down. You could write a simple Macro to do it. Assuming the =COUNT is in C1 just use
    Range("C1").Copy Destination:=Range("C2:C30000")
    If all you want to do is establish the unique items then you could use a Data Filter Advanced to extract a unique list to a blank column.

    HTH
    Richard Buttrey

    If this was useful then please rate it appropriately.

    Click the small star icon at the bottom left of my post.

  3. #3
    Forum Guru snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,151

    Re: finding duplicates in a worksheet

    You can mark the double items in column A:

    Sub tst()
      Range(Join(Filter([transpose(if(countif(offset($A$1,,,row(A1:A30000)),A1:A30000)>1,address(row(A1:A30000),1),""))], "$"), ",")).Interior.ColorIndex = 14
    End Sub



  4. #4
    Registered User
    Join Date
    08-10-2009
    Location
    U.S.
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: finding duplicates in a worksheet

    I didn't quite understand the the range commands but what did seem to work was when I used the =COUNTIF($A1:$A30000,A1) command and then used the filter to find anything that equaled 2. At that point, I just deleted all of the lines. That certainly seemed easier than trying to go through all 30,000 page by page. Thanks again for all your help. I guess I need more training on the advanced commands and etc.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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