Ensure unique values in a column
When you enter data in an Excel spreadsheet, sometimes you want to be sure that you enter unique values only. For
example, if you enter a series of invoice numbers in Column A your Excel spreadsheet, you may want to be sure that you do not enter the same invoice number twice.
If
you always enter new data at the end of the column, you can use Excel's
built-in data validation to be sure that what you put in there is not also entered somewhere further up the column.
To ensure unique values in a column (Excel 2007), do the following:
- Select a range of cells, for example, column A.
- Select the Data menu, then click on Data Validation (in Data Tools Group).
- In Data Validation dialog box, select Settings -> Allow -> Custom.
- In the Formula box, enter the following formula: =COUNTIF($A$2:$A$20,A2)=1
- Select the Error Alert tab.
- In the Title box, type: Duplicate Entry.
- In the Error message box, type: The invoice number you entered already exists in the list above.
- Click OK.
Try now to enter the same data twice in column A. You will receive an error message.
|
|