View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default IP Address Validation?

On Sun, 19 Oct 2008 16:25:00 -0700, ShaneDevenshire
wrote:

Hi,


2. If you want a stronger data validation then:
Use the custom with a formula of the following type
=AND(LEN(F1)=12,--LEFT(F1,3)<256,--MID(F1,4,3)<256,--MID(F1,7,3)<256,--MID(F1,10,3)<256)
Where you are applying it to the cell F1 to start. Now have the user enter
the IP address without decimal points and use the format I showed in #1.


This disallows many acceptable IP addresses. Among others, it will exclude any
IP addresses where the first octet is less than 100. It also requires that
each octet be entered as three digits, which is not required for a valid IP
address.
--ron