ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Determine if a character is numeric or non-numeric (https://www.excelbanter.com/excel-programming/329109-determine-if-character-numeric-non-numeric.html)

AP[_4_]

Determine if a character is numeric or non-numeric
 
Is there a more efficient way to determine if a single character is a
number versus a non-number?

I use the ASC() function to check for the ASCII values between 48-57?

Thanks in advance


Edwin Tam[_7_]

Determine if a character is numeric or non-numeric
 
Your method is one of the "safest" methods.

Someone may suggest a more "standard" method of using "Isnumeric", for
example:

Isnumeric("1")

However, this is not always "safe", especially in older versions of Excel
(e.g. Excel 5 and 97) Therefore, to test single characters, it's not worth
taking the risk. So, I think using the ASC test is more safe.

Regards,
Edwin Tam

http://www.vonixx.com



"AP" wrote:

Is there a more efficient way to determine if a single character is a
number versus a non-number?

I use the ASC() function to check for the ASCII values between 48-57?

Thanks in advance



NickHK

Determine if a character is numeric or non-numeric
 
AP,
If you wish to be pedantic, what does "½" or "?" mean to you ?

Nick


"AP" wrote in message
oups.com...
Is there a more efficient way to determine if a single character is a
number versus a non-number?

I use the ASC() function to check for the ASCII values between 48-57?

Thanks in advance





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

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