+ Reply to Thread
Results 1 to 12 of 12

Avoid duplicate entries across 2 worksheets

  1. #1
    Registered User
    Join Date
    02-03-2011
    Location
    Massachusetts
    MS-Off Ver
    Excel 2007
    Posts
    5

    Avoid duplicate entries across 2 worksheets

    In an Excel workbook, I've got data in one column on two worksheets. The second worksheet contains old data. New data is entered in the first worksheet. I need to avoid duplicate entries, i.e. if I try to enter a phone number that is already on either sheet, it will not allow the phone number to be added.

    I have no problem accomplishing this with a COUNTIF formula in data validation, but I can't seem to figure out how to check to see if it's on the second worksheet.

    New numbers are constantly being added and it can't be something where you have to go back and run a search afterwards, it needs to notify the user that the number exists right when it is entered.

    Any help is greatly appreciated!

    -Chris

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Avoid duplicate entries across 2 worksheets

    Try this

    Make make your list on Sheet2 a named range, say "OldList"

    Then in the range you want to validate, say column A
    Data Validation > Custom

    =COUNTIF(OldList,A1)=0

    Hope this helps
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  3. #3
    Forum Contributor TechRetard's Avatar
    Join Date
    06-14-2009
    Location
    Houston, TX
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: Avoid duplicate entries across 2 worksheets

    another method would be to copy list one beneath list two (so you have one long list)...then just do a pivot table on the large list (put phone # in the row field) ... this will combine like data....then just copy and paste your new list

    (sorry my example was created in newer version so pivot might not work)
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    02-03-2011
    Location
    Massachusetts
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Avoid duplicate entries across 2 worksheets

    Quote Originally Posted by Marcol View Post
    Try this

    Make make your list on Sheet2 a named range, say "OldList"

    Then in the range you want to validate, say column A
    Data Validation > Custom

    =COUNTIF(OldList,A1)=0

    Hope this helps
    Hi Marcol,

    Thanks, I tried and it didn't seem to work. Do I need to reference the second worksheet in the formula?

    TechRetard, I need to be able to verify that the input is unique without taking extra steps. Once the number is put in, it needs to kick back with an error message if the number exists on either worksheet.

    Thanks guys!

  5. #5
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Avoid duplicate entries across 2 worksheets

    Try this demo workbook.

    There are errors purposely added to the sheet to demonstrate. Select one of the incorrect numbers and try re-entering it

    The check column is not required and is only there to give proof of the validation.

    Also there is a possible conditional formatting solution on Sheet1

    Hope this helps
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    02-03-2011
    Location
    Massachusetts
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Avoid duplicate entries across 2 worksheets

    Marcol,

    Thanks for posting that! How would I combine the two example spreadsheets so that it will only allow the new data if it doesn't exist on sheet1 OR on sheet2?

  7. #7
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Avoid duplicate entries across 2 worksheets

    Try this

    In addition to "OldList"
    Name your new list, say "New List"

    Note:= Both named ranges are dynamic and must be continuous.

    Then

    Data Validation > Custom

    =AND(COUNTIF(OldList,A2)=0,COUNTIF(NewList,A2)=1)


    Hopr this helps
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    02-03-2011
    Location
    Massachusetts
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Avoid duplicate entries across 2 worksheets

    I'm having trouble figuring out how those worksheets work I guess. It doesn't stop me from entering duplicate values from what I can see.

    I've attached the file I'm working with, maybe it will be easier to see what specifically I'm trying to do.

    In the tab/sheet titled "New Leads", I'll be entering data including email and phone number. Those two columns are the ones that need to be unique.

    After the new leads are entered, they will be processed one by one with a phone call and/or an email. When they are processed, they will be moved to either the "No Response" sheet, the "Not Interested" sheet, or the "Interested" sheet, depending on the outcome.

    Rather than checking those 3 sheets for duplicates being entered on "New Leads", I created the "Master List" sheet where a copy of ALL the leads will go as they are taken from the "New Leads" sheet and categorized in one of the 3 categories I mentioned before. This way (I figure), if I try to put a phone number in to "New Leads" that already exists somewhere else (either No Response, Not Interested, or Interested), it will only need to check the "Master List" to see if the phone number or email has already been processed.

    Thanks again for all the help!
    Attached Files Attached Files

  9. #9
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Avoid duplicate entries across 2 worksheets

    Hmm?

    Not what I expected to see, I'll think it over.
    Got to go now, I'll give it a go tomorrow if nobody else solves your problem before then.

    Cheers.

  10. #10
    Registered User
    Join Date
    02-03-2011
    Location
    Massachusetts
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Avoid duplicate entries across 2 worksheets

    Thank you very much for all your help, I'm still trying to figure it out on my own as well....
    Surprised at how difficult this is turning out to be! oh well :-)

  11. #11
    Registered User
    Join Date
    08-01-2017
    Location
    Kuwait
    MS-Off Ver
    2016
    Posts
    12

    Re: Avoid duplicate entries across 2 worksheets

    Quote Originally Posted by Marcol View Post
    Hmm?

    Not what I expected to see, I'll think it over.
    Got to go now, I'll give it a go tomorrow if nobody else solves your problem before then.

    Cheers.
    Dear Marcol;

    I was trying to apply the guidelines what you have given through above posts but it doesn't work properly. Could you advice me in this regard?

    I have attached the excel file here.

    Thanks in advance.
    Attached Files Attached Files

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,410

    Re: Avoid duplicate entries across 2 worksheets

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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