Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Check for dual key Duplicates

I have a workbook where I need the user to be able to enter only one entry
for a two column pair.

Column A is an identifier number and Column B is a date, so:

#1, 10/16/2009
#1, 11/16/2009
#2, 10/16/2009

is valid but,
#1, 10/16/2009
#1, 10/16/2009
#2, 11/16/2009

would not be valid.

I've thought about concatenating these two fields in another sheet and then
doing a vlookup on this table and if it is N/A it would mean it's not
previously used, but that seems clunky...As well as doing a loop to determine
if it's been used since this sheet can have thousands of entries.

Is there a simple way of doing this that I might be missing?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Check for dual key Duplicates

Hello Bryan,

You could try the following.
Assume that the numbers are in column A and the dates are in column B.
In column C concatenate columns A and B with the following formula. (The
example is in cell C2 assuming row 1 has column headers.)

=A2&TEXT(B2,"mmddyyyy")

Copy the formula down in column C for the likely number of rows required.

Select the cells in columns A and B starting at row 2 (cells A2 and B2) for
the number of rows that are likely to be used.

Select Data Validation. (xl2007 in Data ribbon in Data Tools block. Earlier
versions of xl Data-Validation. )

Select Custom under the Allow: field and insert the following formula.
(Assumes that the first cell in the selection is A2.)

=COUNTIF($C:$C,$C2)<=1

At this point there is no need to edit the Input message and Error alert
tabs but you can do that later to enhance if required.

Now each time values are entered in columns A and B, only one unique
concatenated combination is permitted.

--
Regards,

OssieMac


"bryan.t.jackson" wrote:

I have a workbook where I need the user to be able to enter only one entry
for a two column pair.

Column A is an identifier number and Column B is a date, so:

#1, 10/16/2009
#1, 11/16/2009
#2, 10/16/2009

is valid but,
#1, 10/16/2009
#1, 10/16/2009
#2, 11/16/2009

would not be valid.

I've thought about concatenating these two fields in another sheet and then
doing a vlookup on this table and if it is N/A it would mean it's not
previously used, but that seems clunky...As well as doing a loop to determine
if it's been used since this sheet can have thousands of entries.

Is there a simple way of doing this that I might be missing?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Check for Duplicates then Sum cells of duplicates aileen Excel Programming 7 December 11th 08 03:15 PM
check for duplicates Todd Excel Worksheet Functions 0 November 7th 06 05:59 PM
Check for Duplicates nebb Excel Worksheet Functions 2 February 13th 06 02:39 PM
Check for Duplicates (RP) Steph[_3_] Excel Programming 2 May 11th 05 08:18 PM
Check for duplicates Pat Excel Worksheet Functions 8 February 17th 05 10:06 PM


All times are GMT +1. The time now is 05:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"