Forum Discussion
Assign a unique 4 digit pincode
I see 2 options using Data Validation:
a) custom formula to stop incorrect entry something like this:
b) you can create a helper list with all possibilities and then Validate to that list:
there are a couple nuances that also need to be addressed. In (a) above I didn't take into account possible PINS like 0000 so if you want to have 0 leading pins then the custom formula would need to change to something like:
=(COUNTIF(C:C,C1)=1)*(C1<1000)*(C1>=0)*ISNUMBER(C1)
and in both cases you need to use Custom Formatting to show all 4 digits (i.e. leading zeros) so under custom just enter 0000
Alternatively you could convert all these items to be TEXT and the cells formatted as TEXT and then in the formula check that the 'TEXT' can covert to a number >=0 and < 1000
One last thought is you could also RANDOMIZE the order of the helper list so that when you do the drop down the 1st item is random...
=LET(a,UNIQUE(VSTACK(E2:E9999,SEQUENCE(9999)),,1),
SORTBY(a,RANDARRAY(ROWS(a))))