This is a warning to all engineers, teachers, scientists, mathematicians and everyone who uses Excel® for simple arithmetic computations.
When the rules of arithmetic were established, many years ago, long before Microsoft® even existed, we taught our children the word "Bodmas", which more recently became "Bedmas" meaning that the order of operators is:
- Brackets
- Exponent
- Division
- Multiplication
- Addition
- Subtraction
Based on this logic our parents would have arrived at the correct answer to the following simple equation:
- (1 + 2)^2 = - 9
In Microsoft® Excel®, and other programs written in Microsoft® C++, things are very different because of "operator overloading".
With these programs you will get the following result:
- (1 + 2)^2 = + 9
Excel® has added 1+2, got 3, assumed the "-" sign means negation (instead of subtraction), therefore changed the 3 to negative 3, then squared this to get the result.
However, if you add a zero to the front of the equation, before the "-" sign, then Excel® will correctly assume subtraction not negation.
As a 'work-around' you should always add a zero before the subtraction sign, assuming subtraction is what you intended (if negation is what you had intended, then you would have left out the minus sign since the result is always positive irrespective of the sign – dah!)
By the way, not all programs perform the same way. Fortran, MathCad, Google's built-in calculator, and many others will always give the correct answer irrespective of whether the leading zero is there or not.
Apparently I am one of the few who strongly believe that Microsoft® should rectify this potentially dangerous situation?
2 comments:
You kidding!!
Go Man Go - David vs Golliath (I mean Microsoft)!
Post a Comment