ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How to determine char or number? (https://www.excelbanter.com/excel-discussion-misc-queries/255758-how-determine-char-number.html)

Eric

How to determine char or number?
 
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

Mike H

How to determine char or number?
 
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.


"Eric" wrote:

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


Jacob Skaria

How to determine char or number?
 
Try
=LOOKUP(CODE(A1),{0,48,58,65,91,97,123},{"",2,"",1 ,"",1,""})

--
Jacob


"Eric" wrote:

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


Jacob Skaria

How to determine char or number?
 
Checkout help on the below two functions

=T()
=N()

--
Jacob


"Eric" wrote:

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


Minty Fresh

How to determine char or number?
 
Hi Eric
This will do the trick:
=IF(ISERROR(LEFT(A1,1)*1),1,2)


"Eric" wrote:

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



All times are GMT +1. The time now is 05:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com