ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Warning while entering duplicate values in a cell (https://www.excelbanter.com/excel-discussion-misc-queries/74451-warning-while-entering-duplicate-values-cell.html)

Raj Mazumdar

Warning while entering duplicate values in a cell
 
Hi there guys

Was just wondering - is there a way to get a warning message pop up (or any
kind of warning) if a value is entered in a cell that already exists in
another cell in that column earlier/later? This will enable me to eliminate
entering duplicate values in a cell in a particular column...

Thanks muchly.

Raj

Elkar

Warning while entering duplicate values in a cell
 
You can use Data Validation to prevent entry of duplicate values.

Select your column (I'll use Column A for this example)
From the Data Menu, select "Validation"
In the Allow field, select "Custom"
Enter the formula: =COUNTIF(A:A,A1)=1

You can also set custom messages to display if duplicates are entered.

Note, this will only prevent manual entry of data from being duplicated. It
will not find existing duplicates or prevent Copy/Pasting duplicate data.

Another option would be to use Conditional Formatting to highlight cells
that contain duplicates. This would allow you to find existing duplicates
and catch Copy/Pasted data. The same formula above could be used there with
one little change. =COUNTIF(A:A,A1)1

HTH,
Elkar



"Raj Mazumdar" wrote:

Hi there guys

Was just wondering - is there a way to get a warning message pop up (or any
kind of warning) if a value is entered in a cell that already exists in
another cell in that column earlier/later? This will enable me to eliminate
entering duplicate values in a cell in a particular column...

Thanks muchly.

Raj


Raj Mazumdar

Warning while entering duplicate values in a cell
 
Thanks Elkar...

"Elkar" wrote:

You can use Data Validation to prevent entry of duplicate values.

Select your column (I'll use Column A for this example)
From the Data Menu, select "Validation"
In the Allow field, select "Custom"
Enter the formula: =COUNTIF(A:A,A1)=1

You can also set custom messages to display if duplicates are entered.

Note, this will only prevent manual entry of data from being duplicated. It
will not find existing duplicates or prevent Copy/Pasting duplicate data.

Another option would be to use Conditional Formatting to highlight cells
that contain duplicates. This would allow you to find existing duplicates
and catch Copy/Pasted data. The same formula above could be used there with
one little change. =COUNTIF(A:A,A1)1

HTH,
Elkar



"Raj Mazumdar" wrote:

Hi there guys

Was just wondering - is there a way to get a warning message pop up (or any
kind of warning) if a value is entered in a cell that already exists in
another cell in that column earlier/later? This will enable me to eliminate
entering duplicate values in a cell in a particular column...

Thanks muchly.

Raj



All times are GMT +1. The time now is 06:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com