View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Validation based on digits in the middle of a string

This will extract the middle digits from a number that contains two dashes.
It may look strange, but it works.

=MID(F25,FIND("-",F25)+1,FIND("-",F25,FIND("-",F25)+1)-FIND("-",F25)-1)

you can put this function into a VLOOKUP.

"TexasStar" wrote:

Here is the scenerio,

I have a number like this 30-015-00745 in cells A2 to A150. The
important part of that number is the 3 middle digits. Example: 015

I have another page that lists several hundred 3 digit combinations.
Example: 015

How can I validate that the 3 middle numbers exist in the list on page
2 where I store all the possible 3 digit combinations that are
allowed?

I have created a named range for the 3 digit numbers on page 2 because
I know the built in validator doesn't like going to a different page
to get a list to validate against. So I created a name range called
"validlist".

Is it possible to perform this validation on the three digits in the
middle of the string 30-015-00745 and if so how might I go about
doing that validation?