XL: Order of Operations in Formulas

Last reviewed: February 2, 1998
Article ID: Q25189

The information in this article applies to:
  • Microsoft Excel for Windows, versions 2.x, 3.0, 4.x, 5.0, 5.0c
  • Microsoft Excel for Windows 95, versions 7.0, 7.0a
  • Microsoft Excel 97 for Windows
  • Microsoft Excel for the Macintosh, version 1.x, 2.x, 3.0, 4.0, 5.0, 5.0a
  • Microsoft Excel for the Power Macintosh, versions 5.0, 5.0a
  • Microsoft Excel 98 Macintosh Edition

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


Additional query words: XL98 XL97 XL7 XL5 XL4 XL3
Keywords : xlformula
Version : WINDOWS:2.x,3.0,4.x,5.0,5.0c,7.0,7.0a,97; MACINTOSH:1.x,2.x,3.0,4.0,5.0,5.0a,98
Platform : MACINTOSH WINDOWS
Issue type : kbinfo


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 2, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.