Sometimes you may want to prevent users from entering duplicate values in a range of Excel cells. For example, you are entering price data for a number of items, and you want to make sure all item numbers entered in range A2:A52 are unique. To prevent duplicates, follow these steps:
- Select the range of cells that will contain the item numbers.
- Go to Data | Validation.
- Click the Settings tab.
- Under Validation Criteria, select Custom.
- Under Formula, enter =COUNTIF($A$2:$A$52,A2)=1.
- Click the Error tab.
- Under Title, enter Duplicate Entry.
- Under Error message, enter an appropriate message, such as: The value was already entered. All Item Numbers must be unique. Please try again.
- Click OK.
Now when the user attempts to enter a duplicate number, Excel will prevent the entry and alert the user with an error message.
Miss a tip?
Check out the Microsoft Excel archive, and catch up on our most recent Excel tips.
Help users increase productivity by automatically signing up for TechRepublic's free Microsoft Office Suite newsletter, featuring Word, Excel, and Access tips, delivered each Wednesday.