Thread: Excel Math Bug
View Single Post
  #18   Report Post  
Posted to microsoft.public.excel.programming
Amedee Van Gasse[_3_] Amedee Van Gasse[_3_] is offline
external usenet poster
 
Posts: 102
Default Excel Math Bug

(reading order fixed)

Fred wrote:

...the wrong sign a math bug,
...And Mathematica calculates the formula differently (the right
way).


Dana DeLouis wrote:


Just guessing here. The only thing that comes to mind of hand
might be the following:

In Excel:
=-5^2
returns +25.

and in mm:
-5^2
-25

A beginning "-" is a "known" little issue with Excel. I think Excel
handles negation a little differently.

Subtracting from zero changes the answer in Excel.
Excel:
=0-5^2
-25

But stays the same in mm:
0-5^2
-25


fred wrote:

Yes Dana, that's it. Good deduction.

It cost me $2000, and a week, to find that out.

it happens directly after the leading equal sign or inside prens.

We found another strange thing with double negatives.
It was something like "=--2" yielded a result of "5" or something
along those lines. But we were in the middle of something
and I didn't write it down. Are you familiar with that one?


This sounds like a documented feature of Excel. So no money.
The workaround is simple: use brackets.

=-5^2
returns +25

=(-5)^2
returns +25

=-(5^2)
returns +25

A math "bug" indeed, but a small one. It took me 2 seconds to find a
workaround. Implementing it for your client might take longer, bu
surely not a whole week.

In short: "Much ado about nothing."

--
Amedee Van Gasse using XanaNews 1.16.3.1
If it has an "X" in the name, it must be Linux?
Please don't thank me in advance. Thank me afterwards if it works or
hit me in the face if it doesn't. ;-)