How to stop duplication in data validation list

Zubair

Active Member
Joined
Jul 4, 2009
Messages
304
Office Version
  1. 2016
Platform
  1. Windows
Mr. Excel.xlsx
ABCDEF
1Entry FormData Base
2BrandSizeBrandSize
3Alpha Kraft20Alpha Kraft20
4Alpha Kraft24Box Board22
5Ultra Fluting26Delta24
6Ultra Fluting32Dubai26
7Delta20Fluting28
8Liner26Liner30
9Special46Nazeer Dubai32
10Nazeer Kraft34
11Nazeer Kraft 16036
12Special38
13Ultra Fluting40
1442
1544
1646
1748
1850
19
20
21
Sheet2
Cells with Data Validation
CellAllowCriteria
A3:A18List=$E$3:$E$13


Hi,

A3:A9 is from E3:E13 and B3:B9 is from F3:F18 through data validation list.

No duplicate combination of Brand & Size is acceptable.

So formula required in data validation in column B that for example when user select Brand "Alpha Kraft" in A3 & A4 and size 20 in B3 and B4 it should stop doing this in B4.

Similarly for all Brands by size duplication.
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
in data validation i have used
=COUNTIFS($A$3:$A$25,A3,$B$3:$B$25,B3)=1

that will stop a duplication , however, not sure how that needs to be linked into the database table ?

extend row25 to cover your data range

Various.xlsx
ABCDEF
1Entry FormData Base
2BrandSizeBrandSize
3Alpha Kraft20Alpha Kraft20
4Alpha Kraft24Box Board22
5Ultra Fluting26Delta24
6Ultra Fluting32Dubai26
7Delta20Fluting28
8Liner26Liner30
9Special46Nazeer Dubai32
10Alpha KraftNazeer Kraft34
11Alpha KraftNazeer Kraft 16036
12Special38
13Ultra Fluting40
1442
1544
1646
1748
1850
Sheet7
Cells with Data Validation
CellAllowCriteria
B3:B18Custom=COUNTIFS($A$3:$A$25,A3,$B$3:$B$25,B3)=1
 
Upvote 0
in data validation i have used
=COUNTIFS($A$3:$A$25,A3,$B$3:$B$25,B3)=1

that will stop a duplication , however, not sure how that needs to be linked into the database table ?

extend row25 to cover your data range

Various.xlsx
ABCDEF
1Entry FormData Base
2BrandSizeBrandSize
3Alpha Kraft20Alpha Kraft20
4Alpha Kraft24Box Board22
5Ultra Fluting26Delta24
6Ultra Fluting32Dubai26
7Delta20Fluting28
8Liner26Liner30
9Special46Nazeer Dubai32
10Alpha KraftNazeer Kraft34
11Alpha KraftNazeer Kraft 16036
12Special38
13Ultra Fluting40
1442
1544
1646
1748
1850
Sheet7
Cells with Data Validation
CellAllowCriteria
B3:B18Custom=COUNTIFS($A$3:$A$25,A3,$B$3:$B$25,B3)=1
Hi etaf - the formula is working perfectly as I needed, but size needs to be selected from the list F3:F18.

I managed to link with database
 
Upvote 0
but size needs to be selected from the list F3:F18.
So it does not matter what the brand is the Size MUST match one of the values in F3:F18

=AND(COUNTIFS($A$3:$A$25,A3,$B$3:$B$25,B3)=1,COUNTIF($F$3:$F$18,B3)>0)

Various.xlsx
AB
1Entry Form
2BrandSize
3Alpha Kraft20
4Alpha Kraft24
5Ultra Fluting26
6Ultra Fluting32
7Delta20
8Liner26
9Special46
10Alpha Kraft
11Nazeer Dubai46
12Nazeer Dubai
13
14
15
16
17
18
Dup-datVal
Cells with Data Validation
CellAllowCriteria
B3:B18Custom=AND(COUNTIFS($A$3:$A$25,A3,$B$3:$B$25,B3)=1,COUNTIF($F$3:$F$18,B3)>0)
 
Upvote 0
Solution
So formula required in data validation in column B that for example when user select Brand "Alpha Kraft" in A3 & A4 and size 20 in B3 and B4 it should stop doing this in B4.
Does this means that In B4 entry only 20 is to be stopped. Or not allow any entry.
 
Upvote 0
So it does not matter what the brand is the Size MUST match one of the values in F3:F18

=AND(COUNTIFS($A$3:$A$25,A3,$B$3:$B$25,B3)=1,COUNTIF($F$3:$F$18,B3)>0)

Various.xlsx
AB
1Entry Form
2BrandSize
3Alpha Kraft20
4Alpha Kraft24
5Ultra Fluting26
6Ultra Fluting32
7Delta20
8Liner26
9Special46
10Alpha Kraft
11Nazeer Dubai46
12Nazeer Dubai
13
14
15
16
17
18
Dup-datVal
Cells with Data Validation
CellAllowCriteria
B3:B18Custom=AND(COUNTIFS($A$3:$A$25,A3,$B$3:$B$25,B3)=1,COUNTIF($F$3:$F$18,B3)>0)
Sorry for the unclear questions, let me rephrase my requirement

Background - This is a sales entry form and each brand has sizes from 20 to 50, when we select a brand with a particular size it brings available stock quantity and the user is selecting selling quantity based on available stock.

In case the user wrongly selects the same brand with the same size, a formula will again bring the same available quantity which is wrong, here we wanted to restrict the user not to select duplicate brand/size combinations in the single sales invoice.

Example

Alpha Kraft size 20 selling quantity 200 from available quantity 250
Alpha Kraft size (21 to 50 with available quantities ok, but size 20 again will be treated as a duplication)

Delta size 21 selling quantity 54 ok
Special size 21 selling quantity 65 ok

Special size 22 selling quantity 15 ok
Special size 22 (stop duplication)

Means the same brand again is ok, the same size different brand is ok but the same brand with the same size in single invoice is not ok.
 
Upvote 0
Sorry do not understand now

My original post above does what you asked in the below

In case the user wrongly selects the same brand with the same size, a formula will again bring the same available quantity which is wrong, here we wanted to restrict the user not to select duplicate brand/size combinations in the single sales invoice.
I do that with
=COUNTIFS($A$3:$A$25,A3,$B$3:$B$25,B3)=1
in Data Validation

I now do not understand your clarification answer example
wheres the quantity in your example - only see size & brand

Means the same brand again is ok, the same size different brand is ok but the same brand with the same size in single invoice is not ok.
So again with
=COUNTIFS($A$3:$A$25,A3,$B$3:$B$25,B3)=1
means you could enter
BrandA
with any size , so long as its not duplicated
1,2,3,4,5,6,7, ad infinitum etc etc

you said
the formula is working perfectly as I needed, but size needs to be selected from the list F3:F18.
do you just want a Selection List based on that size
really confused
 
Upvote 0
Sorry do not understand now

My original post above does what you asked in the below


I do that with
=COUNTIFS($A$3:$A$25,A3,$B$3:$B$25,B3)=1
in Data Validation

I now do not understand your clarification answer example
wheres the quantity in your example - only see size & brand


So again with
=COUNTIFS($A$3:$A$25,A3,$B$3:$B$25,B3)=1
means you could enter
BrandA
with any size , so long as its not duplicated
1,2,3,4,5,6,7, ad infinitum etc etc

you said

do you just want a Selection List based on that size
really confused
etaf, my apologies,

The below formula is working perfectly, I have copied/paste this formula incorrectly, extremely sorry for the inconvenience

=AND(COUNTIFS($A$3:$A$25,A3,$B$3:$B$25,B3)=1,COUNTIF($F$3:$F$18,B3)>0)
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,959
Members
449,096
Latest member
Anshu121

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