+ Reply to Thread
Results 1 to 5 of 5

Duplicates in comparing two columns

  1. #1
    Registered User
    Join Date
    07-24-2007
    Posts
    4

    Duplicates in comparing two columns

    I am have a great deal of trouble. I have to compare over 10000 numbers between two columns. I cannot find a formula that will compare the two rows instead of comparing the information in just that one row. My point is say i have 10,000 numbers in one column and 10,000 in another column. I need to compare the two columns and make sure there are no duplicates between them. Can you help?? I have beensearching through threads and i cant find anything that works!

    ex:

    Col:A Col:B
    1 ---------7
    2 ---------8
    3 ---------9
    4 --------12
    5 --------2 *
    2 --------3 *
    3 --------15
    4 --------1 *
    5 ---------3 *
    6 ---------13

    how can i find these duplicates without looking through each one?
    Last edited by sammyd323; 07-26-2007 at 09:34 AM.

  2. #2
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243
    hi,

    Assuming your first row of data is in row 10 & the data is in columns A & B try entering the following formula in C10 & then copying it across to D10 & down to the end of your data:

    =if((COUNTIF($A$9:$B9,A10)+COUNTIF($A11:$B$1000,A10))>0,"duplicate exists","unique")

    The formula works due to the mix of absolute & relative references by checking if the number/text appears in either the rows above or below the cells own row.

    The above seemed to work in a quick test but if it doesn't work for you have a look at Chip's page:
    HTML Code: 

    hth
    Rob
    Rob Brockett
    Kiwi in the UK
    Always learning & the best way to learn is to experience...

  3. #3
    Registered User
    Join Date
    07-24-2007
    Posts
    4
    Thanks for the reply. Right now i have data up to row 5578. SO what would i change the formula to?

  4. #4
    Forum Contributor
    Join Date
    08-28-2006
    Posts
    280

    Try this

    sammyd323,

    Try this. If your data is in Col A & Col B place this in Cell C1 and copy to the end of your list.

    =IF(COUNTIF($A$1:$A$5578,B1)>0,"duplicate","")

    HTH,

    Dean

  5. #5
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243
    thanks Dean,

    I didn't even realise that I was adding extra unnecessary complexity by using the 2 countifs & ">0" until I saw your post - must be my bed time!

    Sammy, I'm not sure which is the answer you are after so...
    *to count duplicates of a specific value appearing in both columns use (in c1 & copy to D1 & down) :
    =IF(COUNTIF($A$1:$B$5578,A1)>1,"duplicate","ok")

    *to count dup's of specific values listed in column A that appear in col B:
    =IF(COUNTIF($A$1:$a$5578,b1)>0,"duplicate","ok") - as Dean suggested.
    or vice versa:
    =IF(COUNTIF($b$1:$B$5578,A1)>0,"duplicate","ok")


    I put the "ok" in so that you can see that the formulae are working but if you want to prevent visual clutter, just use Dean's empty double quotes "".


    Goodluck & goodnight :-)
    hth
    Rob
    Last edited by broro183; 07-26-2007 at 10:53 AM.

+ 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