View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
keepITcool keepITcool is offline
external usenet poster
 
Posts: 2,253
Default data validation question

assuming the "value" will be entered in a cell with TEXT ("@"")
numberformat and neither element can be 0, try like

=AND(MID(A1,3,1)="-",-LEFT(A1,2)<1,-RIGHT(A1,7)<1)

keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Paul James" wrote:

I would like to restrict data entry in a field that's used to collect
Tax ID or Employer ID numbers. The format for this field should be
two numbers, followed by a hyphen, followed by seven numbers. For
example:

12-1234567

One problem we've been experiencing is that some people have been
entering their social security numbers by mistake, and I'd like to put
a data validation rule in the cell that would require the format for
the Tax ID number as shown above, which would only take the two
digits, hyphen and seven digits.

Can anyone tell me what the rule should be?

Thanks in advance,

Paul