Prevent duplicates in a Data Validation List

slam

Well-known Member
Joined
Sep 16, 2002
Messages
919
Office Version
  1. 365
  2. 2019
I have a column where data is entered via a data validation drop down list that is pulling from =Drivers

How do I also prevent duplicate entries?

Thanks
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
It's kind of complicated. See this:

http://contextures.com/xlDataVal03.html

Ugh, that is complicated. The way it works is fine, maybe even better than just providing an error message in fact, but I'm having trouble applying it. I can't be changing the cell references correctly.

My Data Validation for =Drivers is currently being entered in B2 through B17. (Pulled from a sheet called "Drivers & Standings", also B2 through B17).

I'll keep playing around with it, but any further help would be great appreciated.

Thanks
 
Last edited:
Upvote 0
Ugh, that is complicated. The way it works is fine, maybe even better than just providing an error message in fact, but I'm having trouble applying it. I can't be changing the cell references correctly.

My Data Validation for =Drivers is currently being entered in B2 through B17. (Pulled from a sheet called "Drivers & Standings", also B2 through B17.

I'll keep playing around with it, but any further help would be great appreciated.

Thanks
Ok, just let us know if you need more help.

I can put up a sample file (when I get more time) if you'd like. I would use slightly different formulas.
 
Upvote 0
Ok, just let us know if you need more help.

I can put up a sample file (when I get more time) if you'd like. I would use slightly different formulas.

I'm just going to delete this stupid post in the hope that no one will ever know I asked something so easy :)
 
Last edited:
Upvote 0
I’m so close, but having some little problem.

So again, I’m entering driver names from a drop down in cells B2 through B17 on the ‘Australia’ worksheet

The names are being pulled from B3 through B18 on the ‘Drivers & Standings’ worksheet

Now in attempting to prevent duplicates in B2 through B17 on the ‘Australia’ worksheet, I have added the following

I2 through I17:
=IF(COUNTIF($B$2:$B$17,'Drivers & Standings'!B3)>=1,"",ROW())

J2 through J17:
=IF(ROW('Drivers & Standings'!$B$3:$B$18)-ROW('Drivers & Standings'!B3)+1>COUNT($I$2:$I$17),"",INDEX('Drivers & Standings'!$B$3:$B$18,SMALL($I$2:$I$17,ROW(INDIRECT("1:"&ROWS('Drivers & Standings'!$B$3:$B$18))))))
Entered as an Array Formula

I’ve defined the List of Drivers as “Drivers” with the formula: =OFFSET(Australia!$J$2,0,0,COUNTA(Australia!$J$2:$J$17)-COUNTBLANK(Australia!$J$2:$J$17),1)

So with those formulas, with a blank B2:B17 on the Australia worksheet, I am missing the first driver in column J, and have a #REF! error at the end. However, it does let me enter the other drivers and prevent them being available on the list to enter again.

I can fix the missing driver and #REF! error by changing the first formula above to:

=IF(COUNTIF($B$2:$B$17,'Drivers & Standings'!B3)>=1,"",ROW())-1

Note the “-1” at the end.

However, if I do this, as soon as I entered the first driver in B2, everything errors.

What am I missing?

Thanks
 
Upvote 0
I’m so close, but having some little problem.

So again, I’m entering driver names from a drop down in cells B2 through B17 on the ‘Australia’ worksheet

The names are being pulled from B3 through B18 on the ‘Drivers & Standings’ worksheet

Now in attempting to prevent duplicates in B2 through B17 on the ‘Australia’ worksheet, I have added the following

I2 through I17:
=IF(COUNTIF($B$2:$B$17,'Drivers & Standings'!B3)>=1,"",ROW())

J2 through J17:
=IF(ROW('Drivers & Standings'!$B$3:$B$18)-ROW('Drivers & Standings'!B3)+1>COUNT($I$2:$I$17),"",INDEX('Drivers & Standings'!$B$3:$B$18,SMALL($I$2:$I$17,ROW(INDIRECT("1:"&ROWS('Drivers & Standings'!$B$3:$B$18))))))
Entered as an Array Formula

I’ve defined the List of Drivers as “Drivers” with the formula: =OFFSET(Australia!$J$2,0,0,COUNTA(Australia!$J$2:$J$17)-COUNTBLANK(Australia!$J$2:$J$17),1)

So with those formulas, with a blank B2:B17 on the Australia worksheet, I am missing the first driver in column J, and have a #REF! error at the end. However, it does let me enter the other drivers and prevent them being available on the list to enter again.

I can fix the missing driver and #REF! error by changing the first formula above to:

=IF(COUNTIF($B$2:$B$17,'Drivers & Standings'!B3)>=1,"",ROW())-1

Note the “-1” at the end.

However, if I do this, as soon as I entered the first driver in B2, everything errors.

What am I missing?

Thanks
I'll put up a sample file around 7:00 PM my time (U.S. Eastern Standard Time).
 
Upvote 0
Upvote 0
Thanks - after moving things around to match my columns, I seem to be having the same problem with yours as I'm having with my formulas above. It doesn't like that my data starts in row 3 instead of row 2 on the source list. See attached:

http://cjoint.com/11au/AHEoK7iU6zd.htm
Here you go:

zzzSlam3.xls 18kb

http://cjoint.com/?AHEqstbE9ew

You had the the COUNTIF in the "Selected?" column pointing to the wrong range and in the "source" column you had the ROW(...) function pointing to the wrong range.

I also changed the named formula "Drivers" so the drop down doesn't work at all once all the drivers have been selected.
 
Upvote 0

Forum statistics

Threads
1,224,505
Messages
6,179,152
Members
452,891
Latest member
JUSTOUTOFMYREACH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top