How to determine char or number?

  • Thread starter Thread starter Eric
  • Start date Start date
E

Eric

There is a string in cell A1, which contain char or number. I would like to
return 1 if the left(A1,1) is char, or return 2 if left(A1,1) is number.
Does anyone have any suggestions on how to determine char or number for the
first character of string?
Thanks in advance for any suggestions
Eric
 
Hi,

Try this

=ISNUMBER(LEFT(A1,1)+0)+1
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.
 
Try
=LOOKUP(CODE(A1),{0,48,58,65,91,97,123},{"",2,"",1,"",1,""})
 
Hi Eric
This will do the trick:
=IF(ISERROR(LEFT(A1,1)*1),1,2)
 

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

Back
Top