Microsoft Office Tutorials and References

In Depth Information

**Understanding operator precedence in formulas**

You can, of course, use as many operators as you need to perform the desired calculation.

Here are some examples of formulas that use various operators.

Formula

What it does

=”Part-”&”23A”

Joins (concatenates) the two text strings to produce Part-23A.

=A1&A2

Concatenates the contents of cell A1 with cell A2. Concatenation works

with values as well as text. If cell A1 contains
123
and cell A2 contains

456
, this formula would return the text
123456
.

=6^3

Raises 6 to the third power (216).

=216^(1/3)

Raises 216 to the 1/3 power. This is mathematically equivalent to

calculating the cube root of 216, which is 6.

=A1<A2

Returns
TRUE
if the value in cell A1 is less than the value in cell A2.

Otherwise, it returns
FALSE
. Logical comparison operators also work

with text. If A1 contains
Bill
and A2 contains
Julia
, the formula would

return
TRUE
because
Bill
comes before
Julia
in alphabetical order.

=A1<=A2

Returns
TRUE
if the value in cell A1 is less than or equal to the value in

cell A2. Otherwise, it returns
FALSE
.

=A1<>A2

Returns
TRUE
if the value in cell A1 isn’t equal to the value in cell A2.

Otherwise, it returns
FALSE
.

Understanding operator precedence in formulas

When Excel calculates the value of a formula, it uses certain rules to determine the order in

which the various parts of the formula are calculated. You need to understand these rules

so your formulas produce accurate results.

Table 15.2 lists the Excel operator precedence. This table shows that exponentiation has the

highest precedence (performed ﬁ rst) and logical comparisons have the lowest precedence

(performed last).

TABLE 15.2
Operator Precedence in Excel Formulas

Symbol

Operator

Precedence

^

Exponentiation

1

*

Multiplication

2

/

Division

2

15

+

Addition

3

–

Subtraction

3

&

Concatenation

4

Continues