thestral
thestral

Reputation: 991

Get a message if the value put in a column is not unique

I would like to receive a message in case I put a value that already exists in a column, I've found a way to filter distinct records but nothing that would alert me as soon as I add the new element.

Upvotes: 1

Views: 301

Answers (1)

Doug Glancy
Doug Glancy

Reputation: 27478

As pnuts commented you can use Data Validation and a formula that returns TRUE only when there's one instance of the value in the column. You could use a MATCH formula like he showed, or this COUNTIF formula. This addresses the issue pnuts mentioned of checking the whole column:

=COUNTIF(A:A,A2)=1

I entered this under Custom in the Data Validation dialog:

enter image description here

When the user tries to enter the number a second time, they see this:

enter image description here

Upvotes: 3

Related Questions