Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
jjk jjk is offline
external usenet poster
 
Posts: 42
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
jjk jjk is offline
external usenet poster
 
Posts: 42
Default IsNumeric("121d1") = True ??

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

Thanks,
Jayant

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


  #4   Report Post  
Posted to microsoft.public.excel.programming
jjk jjk is offline
external usenet poster
 
Posts: 42
Default IsNumeric("121d1") = True ??

Thanks for the tips.
Regards,
Jayant

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





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default 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




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

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



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 230
Default 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






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





  #11   Report Post  
Posted to microsoft.public.excel.programming
jjk jjk is offline
external usenet poster
 
Posts: 42
Default IsNumeric("121d1") = True ??

Hi Niek,
It is the VBA function IsNumeric from the Information class.
Regards,
Jayant

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



  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 230
Default 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





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
Disable autoformat of "true" and "false" text drs207 Excel Discussion (Misc queries) 6 April 14th 23 05:33 PM
Check if cells contain the word "Thailand", return "TRUE" ali Excel Worksheet Functions 7 September 14th 07 09:53 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
Typing "true" excel 2007 change it to "TRUE" Mr. T Excel Discussion (Misc queries) 2 April 11th 07 01:24 PM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM


All times are GMT +1. The time now is 11:44 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"