if alpha character

S

samuel

The following cells:

00000000000A
00000000000B
00000000005


if right(a1)=alpha character then everything left of the character, else the
entire field.

How do I code this?
 
D

Dave Peterson

One way using a formula in another cell:
=IF(ISNUMBER(-RIGHT(A1,1)),A1,LEFT(A1,LEN(A1)-1))

or to return a number (not text):
=--(IF(ISNUMBER(-RIGHT(A1,1)),A1,LEFT(A1,LEN(A1)-1)))

Not exactly what you asked, but probably sufficient????
 
T

T. Valko

Another one...

Doesn't account for empty cells:

=LEFT(A1,LEN(A1)-ISERR(-RIGHT(A1)))
 
Top