Prevent duplicates in cells where there is a dropdown list

IvayloKonsulov

New Member
Joined
Feb 24, 2020
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
Hello,

I would like to ask if it is possible to prevent duplicates using data validation in cells where there is a drop down list created with data validation? For example, in my case I have cells in a column (A1:A5) where I have to select an option from a drop down menu using the same list, e.g. fruit (bananas, oranges, apples, peaches, etc.). I want to prevent selecting bananas in 2 cells at the same time. The problem is the only option I think of for preventing duplicates is using data validation and COUNTIF formula, but that will automatically exclude the dropdown list from data validation.

I would be grateful if anyone has some help to offer.
Thanks in advance.
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Welcome to the MrExcel board!

See if this is any use.
I have set up your full list in column D
E1 formula is copied down the same number of rows as the column D list
Data Validation is set up as shown below.
You could hide columns D:F if you want.

A_MrExcel.xlsm
ABCDEF
1bananasoranges$E$1:$E$2
2applesorangespeaches
3apples 
4bananaspeaches 
5
6
DV without duplicates
Cell Formulas
RangeFormula
F1F1=ADDRESS(ROW(E1),COLUMN(E1))&":"&ADDRESS(ROW(E1)+COUNTIF(E1:E4,"?*")-1,COLUMN(E1))
E1:E4E1=IFERROR(INDEX(D$1:D$4,AGGREGATE(15,6,(ROW(D$1:D$4)-ROW(D$1)+1)/ISNA(MATCH(D$1:D$4,A$1:A$5,0)),ROWS(E$1:E1))),"")
Cells with Data Validation
CellAllowCriteria
A1:A5List=INDIRECT($F$1)
 
Upvote 0
Thanks for the quick answer!

Your solution helped me a lot - not only with my current case, but also solved another problem I had.
 
Upvote 0

Forum statistics

Threads
1,223,744
Messages
6,174,252
Members
452,553
Latest member
red83

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