Forum Discussion
dcsaba89blk
Dec 01, 2021Copper Contributor
Excel incorrect formula evaluation
Calculating -(1-2)^2 which equals to -1 Wolfram Alpha correct answer: https://www.wolframalpha.com/input/?i=-%281-2%29%5E2 Google correct answer: https://www.google.com/search?q=-%281-2%29%5E2 Eve...
HansVogelaar
Dec 01, 2021MVP
In Excel, the - operator has higher precedence than the ^ operator, so it evaluates the expression as
-(1-2)^2 = --1^2 = 1^2 = 1.
See Calculation operators and precedence in Excel
We may not agree with this, but we cannot change it, except by adding parentheses:
=-((1-2)^2)
I doubt that Microsoft will be willing to change this, since it would break existing workbooks that depend on this behavior...