Formula Returns Unexpected Positive Value

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 precedencethan a binary operator. This order of precedence may mean that a formulareturns a positive value when you expect it to return a negative value.For example, the formula
is evaluated as:
The 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 ofthis order, the formula
represents the value -1 squared, and returnsthe value 1, a positive value.
To preserve the order of operations in a formula, you can specify that thenegative symbol in a formula apply to the entire formulaby inserting parentheses around the numbers that you want to be evaluatedfirst.

For example, if the earlier fomula
is changed to
the formula returns a negative value, -4.

That has been the standard method for evaluating formulas sincethe first version of Microsoft Excel.

NOTE: This order of operations is different from the order of operations inLotus 1-2-3.
More information
For additional information about the order of evaluation of operators,please see the following article in the Microsoft Knowledge Base:
25189 Excel: Order of Operations in Formulas
The third-party products discussed here are manufactured by vendorsindependent of Microsoft; we make no warranty, implied or otherwise,regarding these products' performance or reliability.

Microsoft Excel 98 Macintosh Edition

For more information about operator precedence, click Contents And Indexon the Help menu (or on the Balloon Help menu if you are using a version ofthe Macintosh operating system earlier than 8.0), click the Index button inExcel Help, type the following text
operators, formulas
and then click Show Topics. Select the "The order in which Microsoft Excelperforms operations in formulas" topic, and click Go To. If you are unableto find the information you need, ask the Office Assistant.

Microsoft Excel 97

For more information about operator precedence in Microsoft Excel, clickthe Index tab in Microsoft Excel 97 Help, type the following text
operators, evaluation order in formulas
and then double-click the selected text to go to the "The order in whichMicrosoft Excel performs operations in formulas" topic.

Microsoft Excel 7.0

In Microsoft Excel Help, type the following text
operators, precedence
and then double-click the selected text to go to the "Operator Precedence"topic.

Microsoft Excel 5.0

For more information about "Mathematical Operator Evaluation in Lotus1.2.3 and Microsoft Excel," click the Search button in Microsoft ExcelHelp, type the following, and then click Display:
unary minus XL98 XL97 XL7 XL5 XL4 XL3 XL

Article ID: 132686 - Last Review: 01/12/2015 15:50:43 - Revision: 2.0

Microsoft Excel 97 Standard Edition, Microsoft Excel 95 Standard Edition, Microsoft Excel 5.0 Standard Edition, Microsoft Excel 98 for Macintosh

  • kbnosurvey kbarchive kbprb KB132686