Why is Excel not doing math properly?

Solution 1:

The -(1/3) is taking precedence over the ^2, so you square -0.33333. Negation takes precedence over exponent.

In the second case, the - sign is not negation, but subtraction, and exponents have precedence over subtraction.

From The Order of Operator Precedence in Excel Formulas

  • Evaluate items in parentheses.
  • Evaluate ranges (:).
  • Evaluate intersections (spaces).
  • Evaluate unions (,).
  • Perform negation (-).
  • Convert percentages (%).
  • Perform exponentiation (^).
  • Perform multiplication (*) and division (/), which are of equal precedence.
  • Perform addition (+) and subtraction (-), which are of equal precedence.
  • Evaluate text operators (&).
  • Perform comparisons (=, <>, <=, >=).

From Wolfram Precedence:

  • Parenthesization,
  • Factorial,
  • Exponentiation,
  • Multiplication and division,
  • Addition and subtraction.

For more complex operations, the order of operations depends on the system.

Wolfram doesn't directly have negation, so interprets the first - as a subtraction.

You are dealing with the idiosynchrancies of the software.