Thread: Data Validation
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove Harlan Grove is offline
external usenet poster
 
Posts: 733
Default Data Validation

Robert_L_Ross wrote...
....
I need to validate that a number entered into a cell is:
9 characters wide
9 numbers (123456789, 012345678, etc.)
OR
Starts with an E and has 8 numbers after it (E12345678, E01234567,
etc.)

....

Unless the cell has the Number format Text, typing 012345678 will
result in 12345678. That is, any leading zeros will be stripped off.
If you'd accept any numeric entry with no more than 9 decimal digits
or E followed by 8 decimal digits, then try

=COUNT(1/(LEN(TEXT(A2,"000000000"))=9),1/(LEFT(A2,1)="E")/
(INT(-RIGHT(A2,8))=-RIGHT(A2,8))/(ABS(50000000-RIGHT(A2,8))<50000000),
1/(INT(A2)=A2)/(ABS(500499999.5-A2)<499500000))=2