View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default how to use wild card in if funtion

=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.
--
Gary''s Student - gsnu200767


"doyree" wrote:

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!!!

"Gary''s Student" wrote:

We can test the last character with ISNUMBER()

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

and copy down
--
Gary''s Student - gsnu200767


"doyree" wrote:

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!!