Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • How To Load Analysis ToolPak in Excel
  • How to calculate current stock or inventory in Excel
  • Randomize/ Shuffle List in Excel
  • How To Remove Duplicates In Excel Column Or Row?
  • How to Sort by Color in Excel

References

  • Last row number in range
  • How to get address of named range in Excel
  • To count total rows in a range in Excel
  • How to use Excel TRANSPOSE Function
  • How to use Excel ROW Function

Data Validations

  • Excel Data validation must contain specific text
  • Excel Data validation number multiple 100
  • Excel Data validation require unique number
  • Data validation must not exist in list
  • Excel Data validation allow weekday only

Prevent Duplicate Entries in Excel

by

This example teaches you how to use data validation to prevent users from entering duplicate values.

1. Select the range A2:A20.

2. On the Data tab, in the Data Tools group, click Data Validation.

3. In the Allow list, click Custom.

4. In the Formula box, enter the formula shown below and click OK.

Explanation: The COUNTIF function takes two arguments. =COUNTIF($A$2:$A$20,A2) counts the number of values in the range A2:A20 that are equal to the value in cell A2. This value may only occur once (=1) since we don’t want duplicate entries. Because we selected the range A2:A20 before we clicked on Data Validation, Excelautomatically copies the formula to the other cells. Notice how we created an absolute reference ($A$2:$A$20) to fix this reference.

5. To check this, select cell A3 and click Data Validation.

As you can see, this function counts the number of values in the range A2:A20 that are equal to the value in cell A3. Again, this value may only occur once (=1) since we don’t want duplicate entries.

6. Enter a duplicate invoice number.

Result. Excel shows an error alert. You’ve already entered that invoice number.

 

Note: to enter an input message and error alert message, go to the Input Message and Error Alert tab.

Post navigation

Previous Post:

VLOOKUP without #N/A error in Excel

Next Post:

Manipulating text strings using Left, Mid, Right, Len, Substitute in Excel

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others

Logical Functions

  • Not Equal To ‘<>‘ operator in Excel
  • NOT function: Description, Usage, Syntax, Examples and Explanation
  • How to use Excel XOR Function
  • How to return blank in place of #DIV/0! error in Excel
  • IF, AND, OR and NOT Functions Examples in Excel

Date Time

  • WEEKDAY function: Description, Usage, Syntax, Examples and Explanation
  • DAYS360 function: Description, Usage, Syntax, Examples and Explanation
  • EDATE function: Description, Usage, Syntax, Examples and Explanation
  • Convert decimal seconds to Excel time
  • EOMONTH function: Description, Usage, Syntax, Examples and Explanation

Grouping

  • Categorize text with keywords in Excel
  • Running count group by n size in Excel
  • Map text to numbers in Excel
  • How to randomly assign data to groups in Excel
  • Map inputs to arbitrary values in Excel

General

  • Zoom Worksheet in Excel
  • How to get Excel workbook path only
  • How to count total columns in range in Excel
  • Customize Ribbon In Excel
  • Creating and Opening an existing file in Excel
© 2025 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning