your image

Operator Precedence - MS-Excel Tutorial

sourcedaddy
Related Topic
:- MS Excel

Operator Precedence

You can use parenthese in your formulas to control the order in which the calculations occur. As an example, consider the following formula that uses references to named cells.

=Income-Expenses*TaxRate

The goal is to subtract expenses from income and then multiply the result by the tax rate. If you enter the above formula, you discover that excel computes the wrong answer. Rather, the formula multiplies expenses by the tax rate and then subtracts the result from the income. The correct way to write this formula is:

=(Income-Expenses)*TaxRate

To understand how this works, you need to be familiar with a concept called operator precedence - the set of rules that excel uses to perform is calculations. Table below shown lists excel's operators precedence. Operators with a lower precedence number are performed before operations with a higher precedence number.

Use parenthese to override excel's built-in order of precedence. Returning to the previous example, the formula without parentheses is evaluate using excel's standard operator precedence. Becuase multiplication has a higher precedence, the Expense cell multiplies by the TaxRate cell. Then, this result is subtracted from Income-Producing an incorrect calculation.

The correct formula uses parentheses to control the order of operations. Expressions within parentheses always get evaluated first. In this case, Expenses is subtracted from Income, and the result multiplies by TaxRate.

 

 

Operator Precedence in Excel FormulasSymbolOperatorPrecedence-Negation1%Percent2^Exponentiations3* and /Multiplication and Division4+ and -Addition and Subtraction5&Text Concatenation6=, <, >, <=, >=, and <>Comparison7

Comments