Written by Allen Wyatt (last updated July 1, 2023)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, 2021, and Excel in Microsoft 365
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:
Figure 1. The Settings tab of the Data Validation dialog box.
=AND(COUNTIF(ValidNames,A1)=1,COUNTIF($A$1:$A$10,A1)=1)
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, 2021, and Excel in Microsoft 365. You can find a version of this tip for the older menu interface of Excel here: Limiting Entry of Names.
Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!
When using data validation, you might want to have Excel display a message when someone starts to enter information into ...
Discover MoreWant to limit what a person can enter into a particular cell? You can use Excel's data validation feature to help enforce ...
Discover MoreThe Data Validation capabilities of Excel can be very helpful when you are trying to control what people can enter into a ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)
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.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2025 Sharon Parq Associates, Inc.
Comments