Reading a text string charachter by charachter....convert string to number

  • Thread starter Thread starter ChuckM
  • Start date Start date
C

ChuckM

I have a text string that contains an age range...:

text_string(1)= 6 - 10
text_string(2) = 11 - 13
text_string(3) = 14 +


I also have an age variable (integer) that I need to assign to an age
group.

e.g.

age = 12
so I need to map this to text_variable(2).

I believe that I can do this if I can read eaxh charachter of the
string...if someone can tell me how to do this.... or is there an
easier way?

Thanks
ChuckM
 
I'm not sure exactly what you are trying to do but if you
need to interrogate the text within a cell lookup these
worksheet functions in help:
Left
Right
Mid
Search

One or more of them may provide your solution.
 
Hi Chuck,
If the text 6 - 11 is in B2 then the formula =LEFT(B2,LEN(B2)-FIND("-",B2))
will give you the 6 as a number.
Any help?
 
Back
Top