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

Data Analysis

  • Excel Line Chart
  • How to create running total in an Excel Table
  • What-If Analysis: Scenarios and Goal Seek in Excel
  • How To Perform and Interpret Regression Analysis in Excel
  • How to calculate average last N values in a table in Excel

References

  • Last row number in range
  • Vlookup Examples in Excel
  • How to use Excel MATCH Function
  • Find Closest Match in Excel Using INDEX, MATCH, ABS and MIN functions
  • How to use Excel OFFSET function

Data Validations

  • Excel Data validation with conditional list
  • Excel Data validation exists in list
  • Excel Data validation allow uppercase only
  • Excel Data validation must begin with
  • Excel Data validation number multiple 100

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

  • OR function: Description, Usage, Syntax, Examples and Explanation
  • Check multiple cells are equal in Excel
  • XOR function: Description, Usage, Syntax, Examples and Explanation
  • IF with boolean logic in Excel
  • Return blank if in Excel

Date Time

  • DATEVALUE function: Description, Usage, Syntax, Examples and Explanation
  • Convert time to time zone in Excel
  • Dynamic date list in Excel
  • Pad week numbers with zeros in Excel
  • Get days, months, and years between dates in Excel

Grouping

  • Group numbers at uneven intervals in Excel
  • Group times into unequal buckets in Excel
  • Group numbers with VLOOKUP in Excel
  • Group times into 3 hour buckets in Excel
  • Categorize text with keywords in Excel

General

  • How to generate random number weighted probability in Excel
  • Transpose: Switch ‘Rows to Columns’ or ‘Columns to Rows’ in Excel
  • How to generate random times at specific intervals in Excel
  • Subtotal by color in Excel
  • How to Create Calendar in Excel
© 2026 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning