View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jerry W. Lewis
 
Posts: n/a
Default MAJOR BUG: Excel operator precedence is wrong

Old news. See Help for "The order in which Microsoft Excel performs
operations in formulas."

-1^2 is ambiguous. The most common convention for order of operations would
interpret it as -(1^2), but as documented, Excel will interpret it as (-1)^2,
and will calculate it correctly given that interpretation. There is no
unversal order of operations that applies to all computer software, so the
user must take responsibility for knowing what their particular package will
do if they intend to write ambiguous expressions.

Jerry

"P Keenan" wrote:

If I enter in a cell "=-1^2" I should see "-1" as the value, not "1". If I
enter "=-A1^2" and the cell A1 contains the value "1", I should see "-1", not
"1". The binary operator "^" should have higher precedence than unary "-",
but does not. (It does have higher precedence than binary "-", as in "=2-2^2"
correctly gives the value "-2", not "0".)

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/comm...et.f unctions