+ Reply to Thread
Results 1 to 6 of 6

No duplicates in 2 columns on 2 different worksheets.

  1. #1
    Forum Contributor
    Join Date
    01-07-2004
    Posts
    192

    No duplicates in 2 columns on 2 different worksheets.

    I have a column on each of two different worksheets in the same workbook that I want to make sure there are no duplicates. Meaning that if I enter the number 332 it will look to see if that number exists anywhere in both of the sheets and return an error if there is a duplicate. Is there an easy way to do something like this?

  2. #2
    Forum Contributor
    Join Date
    02-28-2006
    Posts
    690
    use countif(range1,773) + countif(range2,773)

    if no match it will return zero.

    Or is it more complicated?

  3. #3
    Forum Contributor
    Join Date
    02-28-2006
    Posts
    690
    =if(countif(range1,773)>0,if(countif(range2,773>0,"duplicate exists","no duplicate exists"))

  4. #4
    Forum Contributor
    Join Date
    01-07-2004
    Posts
    192
    Thanks for your response

    What you have posted will work for showing text "Duplicate exists" in a cell I think, but I want to show a message and disallow the ability to let this happen. Is there any way to show a popup if the condition is true?

  5. #5
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi Clayton,

    With this objective in mind, you have to use Data Validation
    Custom Formula

    Please Login or Register  to view this content.
    Adjust formula and ranges to your needs ...

    HTH
    Carim

  6. #6
    Forum Contributor
    Join Date
    01-07-2004
    Posts
    192
    Sorry for the long delay in my reply... I am working on several projects at the moment. I will definitely try your suggestion soon.

    Im not entirely sure what this is doing though...
    Please Login or Register  to view this content.
    It looks to me as though it is comparing only one cell in each page C2 and D2. If that is the case then I don't see how this could work. Even if I copy this all the way down the page it will still only be comparing C2 to the range C2:C200 and D2 to the D2:D200 range. How will it compare C2 to the D2:D200 range and vice versa?
    SUMPRODUCT is a very cool thing and I am trying to understand all it can do. It's just the logic I see that doesn't make sense to me. Can you help me understand?

    One other this I failed to mention is that I already have formula in the C2:C200 cells so can I still use your code?

+ 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