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

Data Analysis

  • Create Scatter Chart in Excel
  • How To Create Frequency Distribution in Excel
  • How To Filter Data in Excel
  • Get column name from index in Excel Table
  • How To Sort One Column or Multiple Columns in Excel

References

  • Approximate match with multiple criteria in Excel
  • How to use Excel COLUMN Function
  • How to use Excel INDIRECT Function
  • How to get address of first cell in range in Excel
  • Find Closest Match in Excel Using INDEX, MATCH, ABS and MIN functions

Data Validations

  • Excel Data validation date in next 30 days
  • Excel Data validation whole percentage only
  • Excel Data validation unique values only
  • Excel Data validation exists in list
  • Excel Data validation no punctuation

Excel Data validation unique values only

by

Reject duplicate data entry in a cell range.

To allow only unique values in a given range, you can use data validation with a custom formula based on the COUNTIF function.

Formula

=COUNTIF(range,A1)<2

Note: Cell references in data validation formulas are relative to the upper left cell in the range selected when the validation rule is defined, in this case B5.

Worked Example:   Count cells that contain specific text in Excel

Explanation

In the example shown, the data validation applied to C5:C9 is:

=COUNTIF(emails,C5)<2

where emails is the named range C5:C9.

Worked Example:   COUNTIF with non-contiguous range in Excel

How this formula works

Data validation rules are triggered when a user adds or changes a cell value. In this example, we are using a formula that checks that the input doesn’t already exist in the named range “emails”:

COUNTIF(ids,B5)<2

COUNTIF returns a count of the value in C5 inside the named range emails (C5:C9). If the count is less than 2, the expression returns TRUE and validation succeeds. If not, the expression returns FALSE and validation fails.

Worked Example:   How to test for all values in a range are at least in Excel

Post navigation

Previous Post:

Number and Text Filters Examples in Excel

Next Post:

Convert date string to date time 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

  • How to use Excel TRUE Function
  • Check multiple cells are equal in Excel
  • XOR function: Description, Usage, Syntax, Examples and Explanation
  • Extract multiple matches into separate rows in Excel
  • SWITCH function: Description, Usage, Syntax, Examples and Explanation

Date Time

  • Two ways to sum time over 30 minutes in Excel
  • Add years to date in Excel
  • Calculate time difference in hours as decimal value in Excel
  • How to calculate most recent day of week in Excel
  • Count holidays between two dates in Excel

Grouping

  • Group numbers with VLOOKUP in Excel
  • How to randomly assign data to groups in Excel
  • Map inputs to arbitrary values in Excel
  • Running count group by n size in Excel
  • How to randomly assign people to groups in Excel

General

  • Share Excel data with Word documents
  • Subtotal by color in Excel
  • AutoFit Column Width, AutoFit Row Height in Excel
  • 231 Keyboard Shortcut Keys In Excel
  • 3D SUMIF for multiple worksheets in Excel
© 2023 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning