XL: Order of Operations in Formulas (25189)



The information in this article applies to:

  • Microsoft Excel for Windows 2.0
  • Microsoft Excel for Windows 2.01
  • Microsoft Excel for Windows 2.1
  • Microsoft Excel for Windows 2.10c
  • Microsoft Excel for Windows 2.10d
  • Microsoft Excel for Windows 3.0
  • Microsoft Excel for Windows 4.0
  • Microsoft Excel for Windows 4.0a
  • Microsoft Excel for Windows 4.0c
  • Microsoft Excel for Windows 5.0
  • Microsoft Excel for Windows 5.0c
  • Microsoft Excel for Windows 95
  • Microsoft Excel for Windows 95 7.0a
  • Microsoft Excel 97 for Windows
  • Microsoft Excel for the Macintosh 1.0
  • Microsoft Excel for the Macintosh 1.03
  • Microsoft Excel for the Macintosh 1.04
  • Microsoft Excel for the Macintosh 1.06
  • Microsoft Excel for the Macintosh 1.5
  • Microsoft Excel for the Macintosh 1.5a
  • Microsoft Excel for the Macintosh 2.20
  • Microsoft Excel for the Macintosh 2.2a
  • Microsoft Excel for the Macintosh 3.0
  • Microsoft Excel for the Macintosh 4.0
  • Microsoft Excel for the Macintosh 5.0
  • Microsoft Excel for the Macintosh 5.0a
  • Microsoft Excel for the Power Macintosh 5.0
  • Microsoft Excel for the Power Macintosh 5.0a
  • Microsoft Excel 98 Macintosh Edition

This article was previously published under Q25189

SUMMARY

When you combine several operators into a single formula, Microsoft Excel performs the operations in the following order:

   :                 Range
   space             Intersection
   ,                 Union
   -                 Negation
   %                 Percentage
   ^                 Exponentiation
   * or /            Multiplication or Division
   + or -            Addition or Subtraction
   &                 Text Operator
   = < > <= >= <>    Comparison Operators
				

MORE INFORMATION

If you want to alter this order, use parentheses to group expressions in your formula. Microsoft Excel first calculates the expression in parentheses, then uses those results to calculate the formula.

For example, the following formula

   =(5*4+2)
				


returns a value of 22, while the formula

   =5*(4+2)
				


returns a value of 30.

NOTE: This order of operation is different from the order of operation in Lotus 1-2-3.

The 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.

REFERENCES

For more information about operator precedence, click the 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 which Microsoft Excel performs operations in formulas" topic.

For more information about operator precedence, click the Index tab in Microsoft Excel 7.0 Help, type the following text

   operators, precedence
				


and then double-click the selected text to go to the "Operator Precedence" topic.

For more information about "Mathematical Operator Evaluation in Lotus 1.2.3 and Microsoft Excel," click the Search button in Microsoft Excel 5.0 Help, type the following, and then click Display:

   Operator
				

Modification Type:MinorLast Reviewed:8/16/2005
Keywords:kbinfo KB25189