Data Validation of ID Number to accept Leading Zeros

PeterDavids

New Member
Joined
Apr 18, 2013
Messages
16
Office Version
  1. 2019
Platform
  1. Windows
Dear All
I have a column in which I input ID numbers. The data validation checks for the correct format as well as for duplication of numbers in the same column.
This works fine until ID numbers with leading zeroes are input, the validation formula rejects this number,
Below is the validation formula as well as the sample ID number that is rejected by the formula:

=AND(ISNUMBER(F8),LEN(F8)=13,COUNTIF($F$8:$F$701,F8)<=1)
and
0003115218087

The column is also formatted to display the ID Number as follows, 000000" "0000" "000
Could I please ask for assistance with a variation of the validation formula above to accept numbers with leading zeroes?
Thanks
Peter
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Hi PeterDavids,

The format only changes the way you see it, not how it reacts in a formula. A numeric Id is generally a bad thing for the reason you've found, it can be misinterpreted and a common challenge is when it's converted to text but then compared to a numeric Id where the match will fail, even if both look like 3115218087. If you have the opportunity to change it I would do so, just prefix with "X" and it will be treated as text.

Your LEN(F8)=13 fails because Excel sees 3115218087. If you want to stay with a numeric Id then the best check there would be LEN(F8)<=13
 
Upvote 0
Hi Toadstool

Thanks a lot for your workaround, LEN(F8)<=13 did the trick! Unfortunately I am stuck with the numeric Id as its a government issued personal id number given to every citizen.

Much appreciated.
 
Upvote 0
I'm not sure there's a way to mark a question as solved..
 
Upvote 0

Forum statistics

Threads
1,214,797
Messages
6,121,629
Members
449,041
Latest member
Postman24

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