How to pop out a warning if duplicate entered in an Excel column?
If you want to remind users that they cannot enter duplicates with a popped-out warning dialog as below screenshot shown. How can you quickly and easily solve it in Excel? The following methods maybe can give you the answers.
In Excel, you can use a formula in Data Validation to warn and stop entering if a duplicate is entered in a selection.
1. Select a range, supposing A1:A10, and click Data > Data Validation > Data Validation. See screenshot:
2. Then in the Data Validation dialog, under the Settings tab, choose Custom from the Allow drop-down list, and type this =COUNTIF($A$1:$A$10,A1)=1 in the Formula text box. See screenshot:
3. Click Error Alert tab, and check Show error alert after invalid data is entered, and select Stop in the Style list, and specify the title and message contents as you need. See screenshot:
4. Click OK. Now while you entering a duplicate into the selection (A1:A10), the warning dialog will be popped out, and whichever options you choose in the dialog, it will remove the duplicate data you entered.
Tip: If you just want to warn users no entering duplicates only but not remove the entries, in the Data Validation dialog, under Error Alert tab, check Warning in the Style list.
Then while entering a duplicate, a warning pops out to remind you, if you want to retain the duplicate, click Yes or Cancel, if not, click No.
If you do not want to remember the formula, you can use Kutools for Excel’s Prevent Duplicate utility to handle this job.
|Kutools for Excel, with more than 120 handy functions, makes your jobs easier.|
After installing Kutools for Excel, please do as below:（Free Download Kutools for Excel Now!)
Select a range you want to pop out a warning while duplicates entered, click Kutools > Prevent Typing > Prevent Duplicate. See screenshot:
Then click Yes > OK to continue the operation.
Now a warning dialog pops out if you enter a duplicate value in the selection. See screenshot:
With Prevent Typing utility, you also can prevent special characters entering (such as@#$%^), prevent certain characters entering (type them in Prevent type in these chars), or only allow some characters entered (type these lucky characters in Allow to type these chars).