ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   IsNumeric("121d1") = True ?? (https://www.excelbanter.com/excel-programming/333081-isnumeric-121d1-%3D-true.html)

jjk

IsNumeric("121d1") = True ??
 
Hi,

The following texts return true for IsNumeric:
121d1
13124324d7
2892392385d1
and so on

It returns true for a string with a set of number followed by d and a
single number.

I found this to be a strange occurance. Is there a fix or a workaround?

Thanks,
Jayant


jjk

IsNumeric("121d1") = True ??
 
Is there any more non numeric strings that return true, other than the
above sequence?

Thanks,
Jayant


William Benson[_2_]

IsNumeric("121d1") = True ??
 
The 'd' tells excel something special, just like 'e' would. In this case,
what comes after the 'd' indicates # trailing zeros.

HTH
"jjk" wrote in message
oups.com...
Hi,

The following texts return true for IsNumeric:
121d1
13124324d7
2892392385d1
and so on

It returns true for a string with a set of number followed by d and a
single number.

I found this to be a strange occurance. Is there a fix or a workaround?

Thanks,
Jayant




Toppers

IsNumeric("121d1") = True ??
 
Hi,
Try IsNumber e.g.

=Isnumber(A1) where A1 = 121D1 ... will return FALSE

or in VBA

Msgbox application.IsNumber("121D1")

HTH

"jjk" wrote:

Is there any more non numeric strings that return true, other than the
above sequence?

Thanks,
Jayant



Niek Otten

IsNumeric("121d1") = True ??
 
As far as I know, there is no function IsNumeric in Excel.
Looking at the Upper/Lowercase mix, it might be a User Defined Function.
Please tell us more about the function, what you expect it to do how you've
used it before, etc.

--
Kind regards,

Niek Otten

Microsoft MVP - Excel

"jjk" wrote in message
oups.com...
Hi,

The following texts return true for IsNumeric:
121d1
13124324d7
2892392385d1
and so on

It returns true for a string with a set of number followed by d and a
single number.

I found this to be a strange occurance. Is there a fix or a workaround?

Thanks,
Jayant




jjk

IsNumeric("121d1") = True ??
 
Thanks for the tips.
Regards,
Jayant


William Benson[_2_]

IsNumeric("121d1") = True ??
 
IsNumeric is a VB / VBA function
IsNumber is the Excel Worksheet Function

"Niek Otten" wrote in message
...
As far as I know, there is no function IsNumeric in Excel.
Looking at the Upper/Lowercase mix, it might be a User Defined Function.
Please tell us more about the function, what you expect it to do how
you've used it before, etc.

--
Kind regards,

Niek Otten

Microsoft MVP - Excel

"jjk" wrote in message
oups.com...
Hi,

The following texts return true for IsNumeric:
121d1
13124324d7
2892392385d1
and so on

It returns true for a string with a set of number followed by d and a
single number.

I found this to be a strange occurance. Is there a fix or a workaround?

Thanks,
Jayant






jjk

IsNumeric("121d1") = True ??
 
Hi Niek,
It is the VBA function IsNumeric from the Information class.
Regards,
Jayant


Niek Otten

IsNumeric("121d1") = True ??
 
Of course, thanks

--
Kind regards,

Niek Otten

Microsoft MVP - Excel

"jjk" wrote in message
ups.com...
Hi Niek,
It is the VBA function IsNumeric from the Information class.
Regards,
Jayant




Charlie

IsNumeric("121d1") = True ??
 
That "something special" you are referring to is known as "scientific
notation." In Fortran the "e" stands for "exponent", the mantissa being a
single precision number, and the "d" stands for "double", meaning "exponent"
but the mantissa being double precision. VB doesn't seem to differentiate,
i.e. "d" and "e" seem to work the same but maybe both are available for the
sake of standards.

Anyone feel free to correct me if I'm not exactly right about my explanation.

1.234e5 is equivalent to 1.234 * 10 ^ 5
1.234d5 is equivalent to 1.234 * 10 ^ 5


"William Benson" wrote:

The 'd' tells excel something special, just like 'e' would. In this case,
what comes after the 'd' indicates # trailing zeros.

HTH
"jjk" wrote in message
oups.com...
Hi,

The following texts return true for IsNumeric:
121d1
13124324d7
2892392385d1
and so on

It returns true for a string with a set of number followed by d and a
single number.

I found this to be a strange occurance. Is there a fix or a workaround?

Thanks,
Jayant





Charlie

IsNumeric("121d1") = True ??
 
Let me further my examples to make sure you realize the "d" is not the number
of trailing zeros:

1.234e5 is equivalent to 1.234 * 10 ^ 5 which equals 123400.
1.234d-5 is equivalent to 1.234 * 10 ^ -5 which equals .00001234

yes, you can have negative exponents. In fact, if I recall correctly,
Fortran also allows decimal exponents (logarithms)

1.234e5.67 is equivalent to 1.234 * 10 ^ 5.67 which equals 577185.164
1.234e-5.67 is equivalent to 1.234 * 10 ^ -5.67 which equals .000002638245

(if I did my math right)

VB doesn't seem to like decimal exponents.


William Benson[_2_]

IsNumeric("121d1") = True ??
 
Right ... d and e are the same, I was trying to keep it simple (trailing
zeros) as opposed to getting into exponential notation ("10 raised to the
power of...")

I am sure others will benefit from your more precise reply, thanks.

"Charlie" wrote in message
...
That "something special" you are referring to is known as "scientific
notation." In Fortran the "e" stands for "exponent", the mantissa being a
single precision number, and the "d" stands for "double", meaning
"exponent"
but the mantissa being double precision. VB doesn't seem to
differentiate,
i.e. "d" and "e" seem to work the same but maybe both are available for
the
sake of standards.

Anyone feel free to correct me if I'm not exactly right about my
explanation.

1.234e5 is equivalent to 1.234 * 10 ^ 5
1.234d5 is equivalent to 1.234 * 10 ^ 5


"William Benson" wrote:

The 'd' tells excel something special, just like 'e' would. In this case,
what comes after the 'd' indicates # trailing zeros.

HTH
"jjk" wrote in message
oups.com...
Hi,

The following texts return true for IsNumeric:
121d1
13124324d7
2892392385d1
and so on

It returns true for a string with a set of number followed by d and a
single number.

I found this to be a strange occurance. Is there a fix or a workaround?

Thanks,
Jayant







William Benson[_2_]

IsNumeric("121d1") = True ??
 
I was a mathematics major about 22 years ago, but that doesn't mean I know
how to express facts precisely anymore, I guess! When an OP shows a bunch of
numbers all which are positive integers, some expressed in "d" notation, I
say "number of trailing zeros" without even thinking because that is what
they worked out to be in his case: Your additional clarity (and recognizing
the need for it) is appreciated not just by myself, but by all reading the
post I am sure... thanks.

Bill

"Charlie" wrote in message
...
Let me further my examples to make sure you realize the "d" is not the
number
of trailing zeros:

1.234e5 is equivalent to 1.234 * 10 ^ 5 which equals 123400.
1.234d-5 is equivalent to 1.234 * 10 ^ -5 which equals .00001234

yes, you can have negative exponents. In fact, if I recall correctly,
Fortran also allows decimal exponents (logarithms)

1.234e5.67 is equivalent to 1.234 * 10 ^ 5.67 which equals 577185.164
1.234e-5.67 is equivalent to 1.234 * 10 ^ -5.67 which equals .000002638245

(if I did my math right)

VB doesn't seem to like decimal exponents.





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

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