Ensuring data is unique

tsmithers

New Member
Joined
Nov 15, 2005
Messages
7
I have a column of text (alpha/numeric) of reference numbers. I need to stop anyone entering the same reference number twice in a different cell below the first entry or anywhere within that column.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Take a look at Data>Validation...

You can enter a formula, perhaps a COUNTIF, if you use the Custom option.
 
Upvote 0
tsmithers said:
I have a column of text (alpha/numeric) of reference numbers. I need to stop anyone entering the same reference number twice in a different cell below the first entry or anywhere within that column.

Welcome to MrExcel - use data validation.

Click on the column - we'll assume column A - then

Click Data | Validation

In the Allow box, select Custom

In the Formula box, enter: =COUNTIF(A:A,A1)<2

Make sure Ignore Blank is checked.

Now, no entry can be entered twice.
 
Upvote 0
Hi there tsmithers, welcome to the board!

Assuming that your data range of interest is A1:A10 and A1 is a header row, perform the following ..

1) Select A2:A10
2) Data | Validation | Custom..
3) =COUNTIF($A$2:$A$10,A2)=1
4) Enter any error messges if you'd like, Ok.

Notice the relative reference of A2, that means that A2 is the selected (off-color) cell when you selected your range (clicked A2, then dragged down to A10 and released mouse). Now if you enter "a" in A2, then you cannot enter it in A3:A10, and vice versa if you entered "a" in A5, then you cannot enter it in A3, etc.

HTH

Edit: Too slow for Jon! :LOL:
 
Upvote 0
Thanks guys. Not sure if I clicked on the wrong thing but I didn't mean to report someone. Was trying to say thanks for the post as its provided me with the answer
 
Upvote 0
tsmithers said:
Thanks guys. Not sure if I clicked on the wrong thing but I didn't mean to report someone. Was trying to say thanks for the post as its provided me with the answer
I bet it was me you reported.:)

That's happened before, perhaps I'm doing something wrong.:)
 
Upvote 0
No worries. If it comes up and nothing warrants moderation, the Moderator's leave it be and clear the error. No harm no foul. :)

And Norie doesn't get reported that often. ;)
 
Upvote 0

Forum statistics

Threads
1,214,642
Messages
6,120,701
Members
448,980
Latest member
CarlosWin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top