Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Limiting Entry of Names.

Limiting Entry of Names

Written by Allen Wyatt (last updated April 14, 2018)
This tip applies to Excel 97, 2000, 2002, and 2003


1

Using Excel for entering data is quite common. When you are entering information, you may want to limit what can be placed in a particular cell. For instance, you might be working on an employee register, and you need to make sure that you only enter each employee's name a single time in the worksheet.

One way to approach this challenge is to create a list of allowable names, either on another worksheet or in a different place on the same worksheet. Give this list of names a defined name, such as ValidNames. Then, follow these steps:

  1. Choose the cells where you will be entering employee names; the ones where you want to make sure you only enter each name once. (For this example, let's assume you select cells A1:A10.)
  2. Choose Validation from the Data menu. Excel displays the Data Validation dialog box.
  3. Make sure the Settings tab is displayed. (See Figure 1.)
  4. Figure 1. The Settings tab of the Data Validation dialog box.

  5. In Allow drop-down list, choose Custom.
  6. In the Formula box (which appears when you complete step 4), enter the following formula:
     =AND(COUNTIF(ValidNames,A1)=1,COUNTIF($A$1:$A$10,A1)=1)
  • Click OK to close the dialog box.
  • This validation formula works because it checks the input range (A1:A10) and makes sure that no more than one name from the ValidNames list appears there. There are many other variations on this particular formula that can be used, since Excel does provide many different ways to accomplish the same task. An example of an alternate formula method is provided in the Microsoft Knowledge Base:

    http://support.microsoft.com/kb/213185
    

    While the Knowledge Base article is specifically for Excel 2000, the formula that is at the root of the article (step 7) will work just fine in other versions of Excel.

    These formulaic methods work great if you are typing names into your input list. If you instead prefer to use a drop-down list to select names, there is a slick method presented at this Web page:

    http://www.contextures.com/xlDataVal03.html
    

    What makes it slick is that the drop-down list is dynamic. For instance, when you select a name to go into one cell, that name is removed from the drop-down list used to select names in other cells. Quite nice.

    ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2751) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Limiting Entry of Names.

    Author Bio

    Allen Wyatt

    With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

    MORE FROM ALLEN

    Saving Changes when Closing

    If you write a macro that makes changes to a document, you may want that macro to save those changes. There are several ...

    Discover More

    Using a Custom Format to Add Dashes

    Want some dashes automatically added in values you display in a cell? It may be trickier to develop a custom format than ...

    Discover More

    Updating Automatic Links

    Normally, Word updates links within your document when you first open the document. If you don't want Word to do this, ...

    Discover More

    Dive Deep into Macros! Make Excel do things you thought were impossible, discover techniques you won't find anywhere else, and create powerful automated reports. Bill Jelen and Tracy Syrstad help you instantly visualize information to make it actionable. You’ll find step-by-step instructions, real-world case studies, and 50 workbooks packed with examples and solutions. Check out Microsoft Excel 2019 VBA and Macros today!

    More ExcelTips (menu)

    Answering Questions in Order

    It is not unusual to use Excel to gather the answers to users' questions. If you want your users to answer your questions ...

    Discover More

    Stopping Validated Data from being Overwritten

    Data Validation is a great tool to make sure that data entered in a cell meets whatever criteria you decide. Its ...

    Discover More

    Adding Pop-Up Documentation to a Cell

    Want to have a small help screen pop up when a user selects a particular cell? This can be done by using data validation, ...

    Discover More
    Subscribe

    FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

    View most recent newsletter.

    Comments

    If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

    What is 3 + 2?

    2020-09-05 16:17:55

    David S Holt

    The link provided above, repeated here:
    http://support.microsoft.com/kb/213185

    comes back with a 404 error


    This Site

    Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

    Newest Tips
    Subscribe

    FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

    (Your e-mail address is not shared with anyone, ever.)

    View the most recent newsletter.