recognizing digits in strings

P

papa

I have a column that has codes in it such as A1, A2B3C2,
A2B3, etc.
I am trying to make a column that determines if the
fourth character in the string is a number as opposed to
a letter.
Isnumber and Istext do not seem to work because of
formatting. Because the entire string is not a number it
always returns false.

Is there something I can tweek to get this to work?

TIA
 
D

Dave Peterson

=if(isnumber(-mid(a1,4,1)),"yep","nope")
I have a column that has codes in it such as A1, A2B3C2,
A2B3, etc.
I am trying to make a column that determines if the
fourth character in the string is a number as opposed to
a letter.
Isnumber and Istext do not seem to work because of
formatting. Because the entire string is not a number it
always returns false.

Is there something I can tweek to get this to work?

TIA
 
G

Guest

Another way:

=ISNUMBER(-RIGHT(LEFT(A1,4)))

Returns "True" or "False"

The minus sign before RIGHT forces the result to a number.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top