The operators in a formula are generally evaluated from left to right. Thus, in the following formula the addition is performed first and then the subtraction:
= C7 + A2 – B3
However, this is not always the case. For instance, Excel will perform any exponentiation first, then multiplication or division, then addition or subtraction, then text concatenation, and finally any comparisons. Thus, in the following formula, the multiplication is performed before the addition, even though the multiplication occurs to the right of the addition:
= C12 + D4 * A1
The order in which operators are evaluated is referred to as precedence. Operators with higher precedence are evaluated before those with lower precedence. The following is the order of evaluation for operators in Excel.
Operator | Meaning | |
---|---|---|
– | Negative indicator (such as –123) | |
% | Percent | |
^ | Exponent | |
* and / | Multiplication and division | |
+ and – | Addition and subtraction | |
& | Text concatenation | |
= < > <= >= <> | Comparison |
As you enter formulas, you will want to remember these rules so you can get the desired results. If you cannot remember them or you want to change the order in which operations are performed, you can use parentheses. For instance, if you wanted the addition to occur before the multiplication in the previous formula, you would enter it like this:
= (C12 + D4) * A1
As you work with formulas in Excel, you will find yourself using parentheses quite often. The reason for this is simple—they remove any confusion about how a formula should be processed by Excel.
As a real-world example, suppose you were developing a formula that applied tax to the sum of two different values. For instance, if you want to take the value in cell F2, add $5.00 to it, and then adjust for tax (assuming 5.25% in your state), the formula would be written as follows:
= (F2 + 5) * 105.25%
For the sake of simplicity, if the value in F2 is $95.00, then the result of this formula would be $105.25. Without the parentheses, however, the result would be $100.26 because Excel would do the multiplication (5 * 105.25%) first and then add the result to the value in F2.
Remember, parentheses remove any confusion that might arise concerning what a formula means.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12060) applies to Microsoft Excel 2007, 2010, 2013, and 2016. You can find a version of this tip for the older menu interface of Excel here: How Operators are Evaluated.
Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!
If you have a series of consecutive numbers in a column, you may want to know if it really is consecutive. (In other ...
Discover MoreWhen compiling statistics on a collection of data points, you may want to know whether a particular value is the "highest ...
Discover MoreYou might wonder how you can calculate an IRR (internal rate of return) when the person repaying the loan pays different ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2015-12-20 07:57:24
Roy Taylor
One of the few things I still remember for my Math lessons is BODMAS. This is the order of operation in a mathematical expression.
Of course as with all things it has changed now and is BIDMAS, but it means much the same.
B Brackets
I Indices
D Division
M Multiplication
A Addition
S Subtraction
The division / multiplication and addition / subtraction have no hierarchy but hey.
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2019 Sharon Parq Associates, Inc.
Comments