Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,670
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I get a line under my number that is just 1 char more? megan Excel Discussion (Misc queries) 2 September 22nd 08 06:20 PM
FIND 1 char in cell of any 3 char =True Nastech Excel Discussion (Misc queries) 5 April 26th 08 02:17 PM
Determine Row number JMay Excel Discussion (Misc queries) 3 July 3rd 07 01:40 PM
8500 cells with phone number(7 char.), wishing to add area code (10 char.) [email protected] Excel Discussion (Misc queries) 6 March 10th 06 05:13 PM
LIMIT NUMBER OF CHAR IN A COMBINE CELL rafaeljsg Excel Discussion (Misc queries) 1 October 5th 05 04:15 PM


All times are GMT +1. The time now is 04:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"