Welcome toExcel2007.Tips.Net
Car Tips
Excel2007 Tips
ExcelTips
Health Tips
Using Conditional Formatting to Shade Rows
Making Sure Duplicate Names Aren't Entered
Applying a Conditional Format to a Full Row
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:
=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. 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/?kbid=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 Excel 2007.
Related Tips:
Great Idea! Word is a tool to get what you really want—printed output. This means you need to make sure that Word works as well as possible with your printer, whether it is sitting on your desk or in a room down the hall. Check out WordTips: Printing and Printers today!