When and how formulas recalculate

Your spreadsheet reevaluates formulas automatically each time you change data they refer to. Automatic recalculation occurs in the background, so you can continue working during recalculation.

Formulas recalculate in order of dependence: if a formula uses the results of other formulas, those formulas recalculate before the one that depends on them.

For example, if a formula in B7 depends on the result of a formula in C28, your spreadsheet recalculates the formula in C28 first, even though C28 is farther down the worksheet. This is called recalculating in natural order.

Whenever your spreadsheet performs a recalculation pass, it recalculates only those formulas affected by changes in data. Because your spreadsheet skips over formulas not affected by data changes, it minimizes recalculation time, especially in large sheets that contain many unrelated formulas.



Order of calculation in a formula

Precedence numbers from 1 to 7 represent the order in which your spreadsheet performs operations in a formula. The lower the precedence number, the earlier your spreadsheet performs the operation. Your spreadsheet performs operations with the same precedence number sequentially from left to right.

The order in which you perform arithmetic operations with the same precedence number may produce differences in rounding but otherwise does not matter. However, order is important when evaluating logical operations that contain #AND# and #OR#. A formula can produce different results depending on the order of these operators.

The table below shows the order of precedence for all operators you can use in formulas.

Number Operation Operator
1 Exponentiation ^
2 Identification of value as negative or positive – +
3 Multiplication and division * /
4 Addition and subtraction + –
5 Equal-to test =
5 Not-equal-to test <>
5 Less-than test <
5 Greater-than test >
5 Less-than-or-equal-to test <=
5 Greater-than-or-equal-to test >=
6 Logical-NOT test #NOT#
7 Logical-AND test #AND#
7 Logical-OR test #OR#
7 Text string concatenation &


Overriding order of precedence

You can override the order of precedence in a formula by enclosing operations in parentheses. Your spreadsheet performs operations enclosed in parentheses first. Within each set of parentheses, the precedence numbers listed in the table above apply.

Order of calculation in formulas

For example, to perform addition before multiplication, enclose the addition in parentheses. To see the difference, compare the results of two formulas:



See also
More power with formulas
More power with @functions
When and how formulas recalculate
Controlling how a formula refers to data
Editing a formula
Entering a range address in a formula
Entering a range name in a formula
Copying a formula
Moving a formula