Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Limiting Entry of Names.

Limiting Entry of Names

Written by Allen Wyatt (last updated July 1, 2023)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021


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. Display the Data tab of the ribbon.
  3. Click the Data Validation tool. Excel displays the Data Validation dialog box.
  4. Make sure the Settings tab is displayed. (See Figure 1.)
  5. Figure 1. The Settings tab of the Data Validation dialog box.

  6. In Allow drop-down list, choose Custom.
  7. In the Formula box (which appears when you complete step 5), 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.

    This formulaic method works 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 (7361) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. You can find a version of this tip for the older menu interface of Excel 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

    QuickWords in Word

    WordPerfect users coming to Word may miss a feature called QuickWords. This tip examines some ways you can get around the ...

    Discover More

    Double Indenting

    Indenting a paragraph is easy in Word. In fact, the program provides shortcut keys that make it a snap. Indenting from ...

    Discover More

    Changing Behavior for Audio CDs

    When you place an audio CD in you PC, Windows attempts to play the CD, by default. If you don't want Windows to behave in ...

    Discover More

    Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

    More ExcelTips (ribbon)

    Contingent Validation Lists

    Data validation can be used to create lists of choices for entry into a particular cell. Using the techniques in this tip ...

    Discover More

    Setting Data Validation Input Messages

    When using data validation, you might want to have Excel display a message when someone starts to enter information into ...

    Discover More

    Limiting Choices in a Cell

    Want to limit what a person can enter into a particular cell? You can use Excel's data validation feature to help enforce ...

    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 one less than 9?

    There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


    This Site

    Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu 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.