Article ID: 132686 - View products that this article applies to.
This article has been archived. It is offered "as is" and will no longer be updated.
In Microsoft Excel, when you use a minus sign (-) as a negation operator (for example -1) in a formula, the negation operator has higher precedence than a binary operator. This order of precedence may mean that a formula returns a positive value when you expect it to return a negative value. For example, the formula
=-2^2is evaluated as:
(-2)^2The minus sign is evaluated as a negation operator. The formula returns a positive value, 4.
Microsoft Excel uses an order of calculation to evaluate operators in formulas. The order of evaluation of operators dictates that a minus sign (-) used as a negation operator (such as -1) is evaluated before all other operators. Because of this order, the formula
=-1^2represents the value -1 squared, and returns the value 1, a positive value.
To preserve the order of operations in a formula, you can specify that the negative symbol in a formula apply to the entire formula by inserting parentheses around the numbers that you want to be evaluated first.
For example, if the earlier fomula
=-2^2is changed to
=-(2^2)the formula returns a negative value, -4.
That has been the standard method for evaluating formulas since the first version of Microsoft Excel.
NOTE: This order of operations is different from the order of operations in Lotus 1-2-3.
For additional information about the order of evaluation of operators, please see the following article in the Microsoft Knowledge Base:
25189The third-party products discussed here are manufactured by vendors independent of Microsoft; we make no warranty, implied or otherwise, regarding these products' performance or reliability.
(https://support.microsoft.com/kb/25189/EN-US/ )Excel: Order of Operations in Formulas
Microsoft Excel 98 Macintosh EditionFor more information about operator precedence, click Contents And Index on the Help menu (or on the Balloon Help menu if you are using a version of the Macintosh operating system earlier than 8.0), click the Index button in Excel Help, type the following text
operators, formulasand then click Show Topics. Select the "The order in which Microsoft Excel performs operations in formulas" topic, and click Go To. If you are unable to find the information you need, ask the Office Assistant.
Microsoft Excel 97For more information about operator precedence in Microsoft Excel, click the Index tab in Microsoft Excel 97 Help, type the following text
operators, evaluation order in formulasand then double-click the selected text to go to the "The order in which Microsoft Excel performs operations in formulas" topic.
Microsoft Excel 7.0In Microsoft Excel Help, type the following text
operators, precedenceand then double-click the selected text to go to the "Operator Precedence" topic.
Microsoft Excel 5.0For more information about "Mathematical Operator Evaluation in Lotus 1.2.3 and Microsoft Excel," click the Search button in Microsoft Excel Help, type the following, and then click Display: