IsNumeric("121d1") = True ??

  • Thread starter Thread starter jjk
  • Start date Start date
J

jjk

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
 
Is there any more non numeric strings that return true, other than the
above sequence?

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

HTH
 
Hi,
Try IsNumber e.g.

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

or in VBA

Msgbox application.IsNumber("121D1")

HTH
 
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
 
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
 
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.
 
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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top