Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Excel_2010_Bible.pdf
Скачиваний:
26
Добавлен:
13.03.2015
Размер:
11.18 Mб
Скачать

Chapter 32: Making Your Worksheets Error-Free

Using Excel Auditing Tools

Excel includes a number of tools that can help you track down formula errors. This section describes the auditing tools built in to Excel.

Identifying cells of a particular type

The Go to Special dialog box (as shown in Figure 32.6) is a handy tool that enables you to locate cells of a particular type. To display this dialog box, choose Home Editing Find & Select Go to Special.

Note

If you select a multicell range before displaying the Go to Special dialog box, the command operates only within the selected cells. If a single cell is selected, the command operates on the entire worksheet. n

FIGURE 32.6

The Go to Special dialog box.

You can use the Go to Special dialog box to select cells of a certain type, which can often help you identify errors. For example, if you choose the Formulas option, Excel selects all the cells that contain a formula. If you zoom the worksheet out to a small size, you can get a good idea of the worksheet’s organization (see Figure 32.7). To zoom a worksheet, use the zoom controls on the right side of the status bar. Or, press Ctrl while you move the scroll wheel on your mouse.

661

Part IV: Using Advanced Excel Features

FIGURE 32.7

Zooming out and selecting all formula cells can give you a good overview of how the worksheet is designed.

Tip

Selecting the formula cells may also help you spot a common error: namely, a formula that has been replaced accidentally with a value. If you find a cell that’s not selected amid a group of selected formula cells, chances are good that the cell previously contained a formula that has been replaced by a value. n

Viewing formulas

You can become familiar with an unfamiliar workbook by displaying the formulas rather than the results of the formulas. To toggle the display of formulas, choose Formulas Formula Auditing Show Formulas. You may want to create a second window for the workbook before issuing this command. This way, you can see the formulas in one window and the results of the formula in the other window. Choose View Window New Window to open a new window.

Tip

You can also press Ctrl+` (the accent grave key, typically located above the Tab key) to toggle between Formula view and Normal view. n

662

Chapter 32: Making Your Worksheets Error-Free

Figure 32.8 shows an example of a worksheet displayed in two windows. The window on the top shows Normal view (formula results), and the window on the bottom displays the formulas. Choosing View Window View Side by Side, which allows synchronized scrolling, is also useful for viewing two windows. (See Chapter 4 for more information about this command.)

FIGURE 32.8

Displaying formulas (bottom window) and their results (top window).

Tracing cell relationships

To understand how to trace cell relationships, you need to familiarize yourself with the following two concepts:

Cell precedents: Applicable only to cells that contain a formula, a formula cell’s precedents are all the cells that contribute to the formula’s result. A direct precedent is a cell that you use directly in the formula. An indirect precedent is a cell that isn’t used directly in the formula but is used by a cell that you refer to in the formula.

Cell dependents: These formula cells depend upon a particular cell. A cell’s dependents consist of all formula cells that use the cell. Again, the formula cell can be a direct dependent or an indirect dependent.

For example, consider this simple formula entered into cell A4:

=SUM(A1:A3)

663

Part IV: Using Advanced Excel Features

Cell A4 has three precedent cells (A1, A2, and A3), which are all direct precedents. Cells A1, A2, and A3 each have a dependent cell (cell A4), and they’re all direct dependents.

Identifying cell precedents for a formula cell often sheds light on why the formula isn’t working correctly. Conversely, knowing which formula cells depend on a particular cell is also helpful. For example, if you’re about to delete a formula, you may want to check whether it has any dependents.

Identifying precedents

You can identify cells used by a formula in the active cell in a number of ways:

Press F2. The cells that are used directly by the formula are outlined in color, and the color corresponds to the cell reference in the formula. This technique is limited to identifying cells on the same sheet as the formula.

Display the Go to Special dialog box. (Choose Home Editing Find & Select Go to Special.) Select the Precedents option and then select either Direct Only (for direct precedents only) or All Levels (for direct and indirect precedents). Click OK, and Excel selects the precedent cells for the formula. This technique is limited to identifying cells on the same sheet as the formula.

Press Ctrl+[. This selects all direct precedent cells on the active sheet.

Press Ctrl+Shift+{. This selects all precedent cells (direct and indirect) on the active sheet.

Choose Formulas Formula Auditing Trace Precedents. Excel will draw arrows to indicate the cell’s precedents. Click this button multiple times to see additional levels of precedents. Choose Formulas Formula Auditing Remove Arrows to hide the arrows. Figure 32.9 shows a worksheet with precedent arrows drawn to indicate the precedents for the formula in cell C13.

FIGURE 32.9

This worksheet displays arrows that indicate cell precedents for the formula in cell C13.

664

Chapter 32: Making Your Worksheets Error-Free

Identifying dependents

You can identify formula cells that use a particular cell in a number of ways:

Display the Go to Special dialog box. Select the Dependents option and then select either Direct Only (for direct dependents only) or All Levels (for direct and indirect dependents). Click OK. Excel selects the cells that depend upon the active cell. This technique is limited to identifying cells on the active sheet only.

Press Ctrl+]. This selects all direct dependent cells on the active sheet.

Press Ctrl+Shift+}. This selects all dependent cells (direct and indirect) on the active sheet.

Choose Formulas Formula Auditing Trace Dependents. Excel will draw arrows to indicate the cell’s dependents. Click this button multiple times to see additional levels of dependents. Choose Formulas Formula Auditing Remove Arrows to hide the arrows.

Tracing error values

If a formula displays an error value, Excel can help you identify the cell that is causing that error value. An error in one cell is often the result of an error in a precedent cell. Activate a cell that contains an error value and then choose Formulas Formula Auditing Error Checking Trace Error. Excel draws arrows to indicate the error source.

Fixing circular reference errors

If you accidentally create a circular reference formula, Excel displays a warning message — Circular Reference — with the cell address, in the status bar, and also draws arrows on the worksheet to help you identify the problem. If you can’t figure out the source of the problem, choose Formulas Formula Auditing Error Checking Circular References. This command displays a list of all cells that are involved in the circular references. Start by selecting the first cell listed and then work your way down the list until you figure out the problem.

Using background error-checking feature

Some people may find it helpful to take advantage of the Excel automatic error-checking feature. This feature is enabled or disabled via the Enable Background Error Checking check box, found on the Formulas tab of the Excel Options dialog box, shown in Figure 32.10. In addition, you can use the check boxes in the Error Checking Rules section to specify which types of errors to check.

When error checking is turned on, Excel continually evaluates the formulas in your worksheet. If a potential error is identified, Excel places a small triangle in the upper-left corner of the cell. When the cell is activated, a Smart Tag appears. Clicking this Smart Tag provides you with options.

Figure 32.11 shows the options that appear when you click the Smart Tag in a cell that contains a #DIV/0! error. The options vary, depending on the type of error.

665

Part IV: Using Advanced Excel Features

FIGURE 32.10

Excel can check your formulas for potential errors.

FIGURE 32.11

After you click an error, Smart Tag gives you a list of options.

In many cases, you will choose to ignore an error by selecting the Ignore Error option. Selecting this option eliminates the cell from subsequent error checks. However, all previously ignored errors can be reset so that they appear again. (Use the Reset Ignored Errors button in the Formulas tab of the Excel Options dialog box.)

666

Chapter 32: Making Your Worksheets Error-Free

You can choose Formulas Formula Auditing Error Checking to display a dialog box that describes each potential error cell in sequence, much like using a spell-checking command. This command is available even if you disable background error checking. Figure 32.12 shows the Error Checking dialog box. This dialog box is modeless: that is, you can still access your worksheet when the Error Checking dialog box is displayed.

Caution

The error-checking feature isn’t perfect. In fact, it’s not even close to perfect. In other words, you can’t assume that you have an error-free worksheet simply because Excel doesn’t identify any potential errors! Also, be aware that this error-checking feature won’t catch a very common type of error: namely, overwriting a formula cell with a value. n

FIGURE 32.12

Use the Error Checking dialog box to cycle through potential errors identified by Excel.

Using the Excel Formula Evaluator

Formula Evaluator lets you see the various parts of a nested formula evaluated in the order that the formula is calculated. To use Formula Evaluator, select the cell that contains the formula and then choose Formula Formula Auditing Evaluate Formula to display the Evaluate Formula dialog box (see Figure 32.13).

FIGURE 32.13

The Evaluate Formula dialog box shows a formula being calculated one step at a time.

667

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]