how to use wild card in if funtion

D

doyree

Hello

i have a question regards to using wild card in IF function

A
APPLE 1
APPLE A
APPLE 2
APPLE B

i wrote a formula like that would sort ablove like this
b2=APPLE NUMBER
b3=APPLE LETTER
b4=APPLE NUMBER
and etc.

thank you much!!
 
G

Gary''s Student

We can test the last character with ISNUMBER()

=LEFT(A1,LEN(A1)-1) & IF(ISNUMBER(--RIGHT(A1,1)),"NUMBER","LETTER")

and copy down
 
D

doyree

Gary,

thank you very much for the formula
but how about when those digits or letters at the end has more than 1?
say
apple 123
apple ab
apple 1234
etc

thank you!!!
 
G

Gary''s Student

=LEFT(A1,6) & IF(ISNUMBER(--RIGHT(A1,LEN(A1)-6)),"NUMBER","LETTER")

Note that the number 6 in the above formula is where the space is. If you
had an arbitrary word instead of APPLE, then we would use the FIND() function
to locate that space.
 

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