Author Bio

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company.
Learn more about Allen...

Subscribe

Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your e-mail address and click "Subscribe."

Ensuring Unique Values in a Column

Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Ensuring Unique Values in a Column.

When you are entering information in a worksheet, you may want to ensure that the data being entered is actually unique for a particular column. For instance, if you are entering a series of invoice numbers in column D of a worksheet, you may want to ensure that you don't enter the same invoice number twice.

There are a couple of ways that you can approach such a problem. If you are always entering your new information at the bottom of a column, you can use Excel's data validation feature to make sure that whatever you are entering in the current cell does not match anything higher up in the column. Simply follow these steps:

If you may be entering data anyplace within column D, and you want to know if you are entering a value that is elsewhere in the column (above or below the current cell), then you can follow the above steps, but use this formula in step 4:

=COUNTIF($D:$D,D1)<2

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2650) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Ensuring Unique Values in a Column.

Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!

Leave your own comment:

*Name:

Email:

Notify me about new comments ONLY FOR THIS TIPNotify me about new comments ANYWHERE ON THIS SITEHide my email address

Comments for this tip:

Jenni06 May 2016, 11:41

This formula worked great when I tested it in a blank excel worksheet. But, when I tried it within my existing table it did not work :( Got any idea of how to get it to work in a table? Seems like there's a lot of things that don't work well within a table in excel. Thanks, Jenni

Kadr Leyn23 Jan 2016, 13:07

Thanks for tutorial.

Vba codes can be used in this topic:

"Excel Data Validation List With Unique Values"

Template's video :https://www.youtube.com/watch?v=LiIpObVus7o

mac13 Jan 2016, 12:33

I must be missing something?running MS Office 2016not getting any messages

billyg23 Nov 2015, 08:08

Thanks!!

manpreet12 Aug 2015, 19:19

I want to avoid duplicate data in a comibnation of columns like

Valid DataDate | Shift08 Aug | Night08 Aug | Day

Example of INVALID dataDate | Shift08 Aug | Night08 Aug | Night

So I have to avoid entry of duplicate data in a combination of columns. I am not able to figure it out please help.

sachi16 Jun 2015, 02:53

thank you for this tip

Akshay18 Aug 2014, 02:30

Thanks for the tip!

Michael (Micky) Avidan14 Nov 2013, 07:47

@Yesenia,

In order to avoid duplicate typing and/or copying - try th following Event-macro to be placed in the Worksheets module.The "traditional" Data Validation is not needed in that case.

Thanks for your tips regarding unique values in a column - worked a treat.I wanted to extend this info and allow unique values for the column cell range based on a list.I have already created a form combo box with a list of four values that are in the column N1, N2, N3 and N4.I would like the unique values only based on the selection in the drop down list.Can you help me?

Kind Regards,Ole

Yesenia Bernal10 Jun 2013, 14:50

Hello Allen,

I tried you how to enter values in a column and it worked great. I just have a question it there's a way for it to when you paste numbers not just entered numbers.