Page 325 - Excel 2013 All-in-One For Dummies
P. 325

If B10 contains the number 15 and C10 contains the number 20, the formula in A10 returns the logical value TRUE. If, however, both cell B10 and C10 contain the value 12, the formula returns the logical value FALSE.
The single text operator (the so-called ampersand) is used in formulas to join together two or more text entries (an operation with the highfalutin’ name concatenation). For example, suppose that you enter the following formula in cell C2:
=A2&B2
If cell A2 contains John and cell B2 contains Smith, the formula returns the new (squashed together) text entry, JohnSmith. To have the formula insert a space between the first and last names, you have to include the space as part of the concatenation as follows:
=A2&” “&B2
You most often use the comparison operators with the IF function when building more complex formulas that perform one type of operation when the IF condition is TRUE and another when it is FALSE. You use the concat- enating operator (&) when you need to join text entries that come to you entered in separate cells but that need to be entered in single cells (like the first and last names in separate columns). See Book III, Chapter 2 for more on logical formulas, and Book III, Chapter 6 for more on text formulas.
Order of operator precedence
When you build a formula that combines different operators, Excel follows the set order of operator precedence, as shown in Table 1-2. When you use operators that share the same level of precedence, Excel evaluates each element in the equation by using a strictly left-to-right order.
Formulas 101 307
    Table 1-2
Natural Order of Operator Precedence in Formulas
 Precedence Operator
1 –
2 %
3 ^
4 *and/
5 +and–
6 &
7 =,<,>,<=,>=,<>
Type/Function
Negation
Percent
Exponentiation
Multiplication and Division
Addition and Subtraction
Concatenation
All Comparison Operators
        Book III Chapter 1
 Building Basic Formulas






































































   323   324   325   326   327