A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Bug in Excel's (not VBA's) MOD function



 
 
Thread Tools Display Modes
  #1  
Old October 7th, 2003, 08:04 AM
Harlan Grove
external usenet poster
 
Posts: n/a
Default Bug in Excel's (not VBA's) MOD function

The value 12,345,678,000 is too large to store as a long integer but well
within the range of integers that a double precision floating point real can
store. Excel's worksheet MOD function seems to be able to work with reals,
e.g., MOD(2.25,1/3) returns 0.25 and MOD(2.5,1/3) returns 0.166666666666667.
However, there seems to be a glitch in it when it comes to large integer
values divided by small integer values.

For instance, MOD(12345678000,64) returns #NUM! even though the equivalent
(per online help) expression 12345678000-64*INT(12345678000/64) returns 48
as expected. Clearly Excel's worksheet MOD function isn't just argument
checking wrapped around a call to standard C's fmod(3) call. [No, Microsoft
must have decided they needed to 'enhance' it.]

Maybe this is just a glitch on this particular machine. Does anyone else get
#NUM! from the preceding MOD call? I'm running Excel 97 SR-2 and 2000 SP-3
on this particular machine.


  #2  
Old October 7th, 2003, 08:17 AM
J.E. McGimpsey
external usenet poster
 
Posts: n/a
Default Bug in Excel's (not VBA's) MOD function

I get #NUM! in XL01 and XLv.X.


In article ,
"Harlan*Grove" wrote:

Maybe this is just a glitch on this particular machine. Does anyone else get
#NUM! from the preceding MOD call? I'm running Excel 97 SR-2 and 2000 SP-3
on this particular machine.

  #3  
Old October 7th, 2003, 10:01 AM
Harlan Grove
external usenet poster
 
Posts: n/a
Default Bug in Excel's (not VBA's) MOD function

"J.E. McGimpsey" wrote...
I get #NUM! in XL01 and XLv.X.


So will Microsoft consider this a bug or a feature?


  #4  
Old October 7th, 2003, 02:02 PM
J.E. McGimpsey
external usenet poster
 
Posts: n/a
Default Bug in Excel's (not VBA's) MOD function

In article ,
"Harlan*Grove" wrote:

"J.E. McGimpsey" wrote...
I get #NUM! in XL01 and XLv.X.


So will Microsoft consider this a bug or a feature?


Given their big "mea culpa" on statistical functions,

http://support.microsoft.com/?kbid=828888

I'm hopeful.
  #5  
Old October 7th, 2003, 06:33 PM
Harlan Grove
external usenet poster
 
Posts: n/a
Default Bug in Excel's (not VBA's) MOD function

"J.E. McGimpsey" wrote...
"Harlan*Grove" wrote:

...
Given their big "mea culpa" on statistical functions,

http://support.microsoft.com/?kbid=828888

I'm hopeful.


OK, so how does one submit a bug report for Excel to Microsoft without having to
call their support number and pay for the priviledge of reporting it?

--
Never attach files.
Snip unnecessary quoted text.
Never multipost (though crossposting is usually OK).
Don't change subject lines because it corrupts Google newsgroup archives.
  #6  
Old October 7th, 2003, 07:04 PM
J.E. McGimpsey
external usenet poster
 
Posts: n/a
Default Bug in Excel's (not VBA's) MOD function

One way:

Email

make sure Excel is in the subject line so that it can be routed to
the appropriate product managers.

Mac users have a Feedback item in Office v.X's Help menus that take
them to

http://www.microsoft.com/mac/feedback/suggestion.asp

Don't remember if there's a dedicated site for WinOffice.

In article ,
Harlan wrote:

OK, so how does one submit a bug report for Excel to Microsoft
without having to call their support number and pay for the
priviledge of reporting it?

  #7  
Old October 14th, 2003, 02:45 PM
Ian Smith
external usenet poster
 
Posts: n/a
Default Bug in Excel's (not VBA's) MOD function

"J.E. McGimpsey" wrote in message ...
In article ,
"Harlan*Grove" wrote:

"J.E. McGimpsey" wrote...
I get #NUM! in XL01 and XLv.X.


So will Microsoft consider this a bug or a feature?


Given their big "mea culpa" on statistical functions,

http://support.microsoft.com/?kbid=828888

I'm hopeful.


Sadly, I'm less hopeful. It is undoubtedly a step in the right
direction but not everything in
http://support.microsoft.com/?kbid=828888 is correct, nor are all the
improvements discussed in it always improvements!

For example, it contains the following paragraph.

"In summary, users of earlier versions of Excel should not be troubled
in practice by numeric deficiencies because input values that cause
#NUM! results are extreme. Additionally, you can be assured that if
you receive a result other than an error message, the result is
accurate. Round off error is not a problem here."

Unfortunately this is not correct. A counter-example is
=NEGBINOMDIST(512,512,0.5) which gives 0 when the answer should be
approx 0.0125. Note the parameters are not "big" nor is the answer
"small" by anyone's standards (i.e. there can be no "extreme case"
excuses).

Additionally in the section "Continuous Distribution Inverse
Functions" the suggestion is that the only real problem was the lack
of a good binary search process. In fact, in EXCEL 2000, neither
gammadist nor betadist works even for moderately large parameters,
which is a pretty big hindrance for function inversion!
=GAMMADIST(7000,7000,1,TRUE) gives #NUM!,
=BETADIST(0.5,30000,30000,0,1) also gives #NUM!

I do not wish to unduly criticise the new code added for
BINOMDIST,HYPGEOMDIST & POISSON. In most cases it is an improvement,
albeit it will be very slow when large parameter values are supplied
to the functions. However, for cases such as =POISSON(126,230,TRUE)
the relative error will go from 3e-14 to 0.5. Worse still, cases such
as =POISSON(125,230,TRUE) and =POISSON(125,230,FALSE) will both return
the value 0 which is completely inaccurate. Admittedly, the values are
small in these cases, =POISSON(126,230,TRUE) should deliver approx
5e-14. However, unbelievable though it may seem to Microsoft, there
are wierdos about (self included) who want accurate calculations of
probabilities smaller than 5e-14, who want accurate calculations of
probability functions involving parameters bigger than 30000 and who
want these calculations done lots of times which means they have to be
reasonably efficient!

Ian Smith
  #8  
Old October 14th, 2003, 05:36 PM
James Silverton
external usenet poster
 
Posts: n/a
Default Bug in Excel's (not VBA's) MOD function


"Ian Smith" wrote in message
om...
"J.E. McGimpsey" wrote in message

...
In article ,
"Harlan Grove" wrote:

"J.E. McGimpsey" wrote...
I get #NUM! in XL01 and XLv.X.

So will Microsoft consider this a bug or a feature?


Given their big "mea culpa" on statistical functions,

http://support.microsoft.com/?kbid=828888

I'm hopeful.


Sadly, I'm less hopeful. It is undoubtedly a step in the right
direction but not everything in
http://support.microsoft.com/?kbid=828888 is correct, nor are all the
improvements discussed in it always improvements!

For example, it contains the following paragraph.

"In summary, users of earlier versions of Excel should not be troubled
in practice by numeric deficiencies because input values that cause
#NUM! results are extreme. Additionally, you can be assured that if
you receive a result other than an error message, the result is
accurate. Round off error is not a problem here."

Unfortunately this is not correct. A counter-example is
=NEGBINOMDIST(512,512,0.5) which gives 0 when the answer should be
approx 0.0125. Note the parameters are not "big" nor is the answer
"small" by anyone's standards (i.e. there can be no "extreme case"
excuses).


You are certainly correct! NEGBINOMDIST does not give an error message in
Excel XP (2002, I suppose) either and returns zero. The formula seems to
fail for numbers larger than 511. I suppose that is because of the immense
numerical values of the combinations involved but I wonder why Microsoft
does not use their own suggestion?

NEGBINOMDIST(number_s, number_f, probability_s) =

BINOMDIST(number_s, number_f + number_s - 1, probability_s, false) *
probability_s.



This actually gives an apparently correct answer in Excel 2002.




--
James V. Silverton
Potomac, Maryland, USA

  #9  
Old October 7th, 2003, 10:14 AM
Harlan Grove
external usenet poster
 
Posts: n/a
Default Bug in Excel's (not VBA's) MOD function

"Harlan Grove" wrote...
....
For instance, MOD(12345678000,64) returns #NUM! . . .

....

FWIW, the Works 2000 (ver 5) spreadsheet also returns an error, but
OpenOffice Calc 1.0 returns 48 as expected. While I haven't tested this
under other spreadsheets (yet), I think it's safe to say this, er,
functionality is unique to Microsoft.


  #10  
Old October 7th, 2003, 06:45 PM
Harlan Grove
external usenet poster
 
Posts: n/a
Default Bug in Excel's (not VBA's) MOD function

"Harlan*Grove" wrote...
"Harlan Grove" wrote...
...
For instance, MOD(12345678000,64) returns #NUM! . . .

...

FWIW, the Works 2000 (ver 5) spreadsheet also returns an error, but
OpenOffice Calc 1.0 returns 48 as expected. While I haven't tested this
under other spreadsheets (yet), I think it's safe to say this, er,
functionality is unique to Microsoft.


And FWIW, Lotus 123 releases 5 and 9.7, Quattro Pro 10 and OpenOffice Calc 1.1
all give the correct/expected result of 48. I'm not going to bother testing
various windows shareware/freeware or Linux spreadsheets.


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:44 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.