Page 238 - Excel 2007 Bible
P. 238

16_044039 ch11.qxp  11/21/06  11:04 AM  Page 195
                                                                                       Introducing Formulas and Functions
                                             This formula will always return the sum of all the data, even if rows or columns are added or deleted. And if
                                             you change the name of Table1, Excel will adjust formulas that refer to that table automatically. For exam-
                                             ple, if you renamed Table1 to be AnnualData (by using the Name Manager), the preceding formula
                                            would be changed to:
                                                 =SUM(AnnualData)
                                             Most of the time, you’ll want to refer to a specific column in the table. The following formula returns the
                                             sum of the data in the Actual column:
                                                 =SUM(Table1[Actual])
                                             Notice that the column name is enclosed in square brackets. Again, the formula adjusts automatically if you
                                             change the text in the column heading.
                                             Even better, Excel provides some helpful assistance when you create a formula that refers to data within a
                                             table. Figure 11.13 shows the formula autocomplete helping to create a formula by showing a list of the
                                             elements in the table.
                                      FIGURE 11.13
                                     The formula autocomplete feature is useful when creating a formula that refers to data in a table.  11
                                             Correcting Common Formula Errors
                                             Sometimes, when you enter a formula, Excel displays a value that begins with a hash mark (#). This is a sig-
                                             nal that the formula is returning an error value. You have to correct the formula (or correct a cell that the
                                             formula references) to get rid of the error display.
                                           TIP         If the entire cell is filled with hash-mark characters, this means that the column isn’t wide
                                           TIP
                                                       enough to display the value. You can either widen the column or change the number format of
                                            the cell.
                                             In some cases, Excel won’t even let you enter an erroneous formula. For example, the following formula is
                                             missing the closing parenthesis:
                                                 =A1*(B1+C2
                                             If you attempt to enter this formula, Excel informs you that you have unmatched parentheses, and it pro-
                                             poses a correction. Often, the proposed correction is accurate, but you can’t count on it.
                                             Table 11.3 lists the types of error values that may appear in a cell that has a formula. Formulas may return
                                             an error value if a cell to which they refer has an error value. This is known as the ripple effect — a single
                                             error value can make its way into lots of other cells that contain formulas that depend on that one cell.

                                                                                                                      195
   233   234   235   236   237   238   239   240   241   242   243