ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   When does ISNUMERIC point to a number? (https://www.excelbanter.com/excel-programming/335616-when-does-isnumeric-point-number.html)

davidm

When does ISNUMERIC point to a number?
 

Help file indicates ISNUMERIC(expression) evaluates the expression to a
boolean value (True or False) depending upon whether it is a number or
not. It seems a simple concept. But as he so often does, Tom Ogilvy has
dazzled me with the following revelations (which are verified):

isnumeric("02,21,14.23")
True
? isnumeric("35E1")
True
? isnumeric("34D1")
True

I would add that while Isnumeric("5abc") -- False
Isnumeric("5abc7")---True
The presence of the first and last characters being present in the
STRING is crucial.

I await enligtenment. TIA


--
davidm
------------------------------------------------------------------------
davidm's Profile: http://www.excelforum.com/member.php...o&userid=20645
View this thread: http://www.excelforum.com/showthread...hreadid=390472


Patrick Molloy[_2_]

When does ISNUMERIC point to a number?
 
Excel will try to convert a string to a number. if it can, then ISNUMERIC
will be true.
A text string such as "5E2" can be converted to 5 x 10^2 := 500

however, I get this

?isnumeric("5abc7")
False

Excel XP, SP3


"davidm" wrote:


Help file indicates ISNUMERIC(expression) evaluates the expression to a
boolean value (True or False) depending upon whether it is a number or
not. It seems a simple concept. But as he so often does, Tom Ogilvy has
dazzled me with the following revelations (which are verified):

isnumeric("02,21,14.23")
True
? isnumeric("35E1")
True
? isnumeric("34D1")
True

I would add that while Isnumeric("5abc") -- False
Isnumeric("5abc7")---True
The presence of the first and last characters being present in the
STRING is crucial.

I await enligtenment. TIA


--
davidm
------------------------------------------------------------------------
davidm's Profile: http://www.excelforum.com/member.php...o&userid=20645
View this thread: http://www.excelforum.com/showthread...hreadid=390472



Patrice[_3_]

When does ISNUMERIC point to a number?
 
The problem is "what is a number" ?

If you meant only numbers and decimal and thousands separator, Excel is a
bit "smarter" than that an will validate a "number" that uses scientific
notation, currency character etc...

IMO, most often your best bet is to build your own function depending on
what exactly you are after (i.e. if you need to handle exactly the format
you want)...

--
Patrice


"davidm" a écrit dans
le message de ...

Help file indicates ISNUMERIC(expression) evaluates the expression to a
boolean value (True or False) depending upon whether it is a number or
not. It seems a simple concept. But as he so often does, Tom Ogilvy has
dazzled me with the following revelations (which are verified):

isnumeric("02,21,14.23")
True
? isnumeric("35E1")
True
? isnumeric("34D1")
True

I would add that while Isnumeric("5abc") -- False
Isnumeric("5abc7")---True
The presence of the first and last characters being present in the
STRING is crucial.

I await enligtenment. TIA


--
davidm
------------------------------------------------------------------------
davidm's Profile:

http://www.excelforum.com/member.php...o&userid=20645
View this thread: http://www.excelforum.com/showthread...hreadid=390472





All times are GMT +1. The time now is 10:24 AM.

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