Tips and Tricks

In this section, you see some tips and tricks you can use when working with formulas. Depending on how often you use Excel, you might find some of the following procedures more useful than others.

To get an overview of a sheet with many formulas and connections, you can view the underlying formulas instead of the results. This is often useful if the sheet was created by someone else:

Excel switches from displaying the results to displaying the underlying formulas. Because the formulas need more space, Excel adjusts the column width automatically.

If you know that a formula has to be entered into several cells, you can enter the formula in three simple steps:

The selected range is filled with the formula.

In workbooks with similar sheets, you can enter formulas (or other content) in several worksheets at the same time. You just have to select (group) the desired sheets:

The formula (or formulas) are written in all selected sheets. You can also combine the method shown previously for entering formulas in several rows with the method for entering formulas in several sheets.

Excel highlights all cells containing formulas if you perform the following steps:

If you have to work through all selected formula cells, press the Tab key to switch between the selected cells. You can also edit a formula in the formula bar. Press Shift+Tab to move in the opposite direction.

To unselect but still work through all formulas, assign a color to the selected cells (you can remove the color later).

To see which cells a formula refers to, press the F2 key. This opens the cell for editing and shows the cell references in different colors (see Figure 3-17).

In large tables, entering each formula requires a lot of effort. If you know how to copy formulas you can reduce the amount of work required to enter formulas. The same applies to corrections. If you know how to move formulas and values, you can quickly rearrange your table.

You must always select the range you want to copy or move. As with all Windows applications, you have two options for making a selection:

To move a formula cell, you actually delete the formula in the original cell and paste it into another cell. There are two approaches to do this:

If you copy data, the data remains in the initial location and a copy of the data is pasted at another location. When copying formulas, it is important to know whether the formula references are relative, absolute, or mixed (see the section References in Formulas earlier in this chapter).

The following approaches are available for copying formulas:

  • Selecting the Copy and Paste options in the Clipboard group on the Home tab

  • Copying the formula cell by using the mouse

  • Dragging the fill handle of the formula cell

The results of the first two approaches are the same.

To copy cells by using the mouse, you basically do the same as you would to move cells with the mouse. Perform the following steps:

Make sure you release the mouse button first and then the Ctrl key. If you release the Ctrl key first, the copy command is canceled and the cell content is moved.

Click the copied cells and review the cell content in the formula bar to check whether the content has changed. For a better understanding, see the next section.

In Figure 3-20, the formula in cell D4 was copied to several different locations. Remembering the section Relative References earlier in this chapter, ask yourself the following questions: What calculation is related to the original cell (cell D4 in Figure 3-20)? Which cells, starting at cell D4, should be multiplied? What does the calculation look like after the cells are copied?

The calculation in cell D4 could read like this: “Multiply the two adjacent cells on the left.” This calculation was copied exactly to all other cells:

In other words: The cell references changed in relation to their locations, but the initial calculation—embedded in the formula—remains the same at all locations.

As you already know, a cell reference with these properties is called a relative reference. If you want the copied formulas to anchor on particular cells, you have to use absolute or mixed cell references.

There are many occasions when you may want to fix your data. For example, you might need to archive a snapshot of the results and want to avoid recalculation, or you might want to avoid having data linked back to other workbooks.

To convert results to fixed values, you use the right mouse button:

Or use the Copy and Paste functions:

Assume that you have a table of readings in meters that you want to convert to feet. Follow these steps:

To prevent your formulas from being changed by other users, you can protect certain cell ranges or formula cells.

There are two points to remember when protecting cells. First, all cells are locked by default. Second, the lock is activated only when the sheet is protected. Common practice is to leave all cells protected and unlock only those in which you want users to enter information.

To do this, perform the following steps:

Now other users cannot enter information into any cells other than those that have been unlocked.

If you want to protect only a limited number of cells, start by selecting the entire sheet and unlocking the cells by using the Format Cells option. Then repeat the preceding steps to lock a selection of cells. Finally, protect the sheet.

You can go one step further and ensure that the formulas in your formula cells are not displayed in the formula bar. To do this, perform the following steps:

Regardless of whether the cell is locked, the formula is not displayed in the formula bar when the sheet is protected.

You can specify when Excel should perform a calculation. You can find the options for this in Tools/Options on the Calculation tab (Excel 2003). In Excel 2007 and Excel 2010, use the buttons in the Calculation group on the Formulas tab (see Figure 3-24).

The following options are available:

All settings are available on the File tab, by choosing Options and clicking the Formulas tab. Figure 3-25 shows the calculation options in Excel 2007 and Excel 2010, which reduced the selection available from previous versions.

When you edit a formula, Edit mode shows all of the cells and cell ranges referenced in the formula, as well as their borders, in specific colors. This way you can easily create cell references.

To switch into Edit mode, double-click the formula cell or select the formula cell and press the F2 key.

You can use formula auditing to show the relationships between cells. To check which cells are used by a formula, enable formula auditing.

Until Excel 2007, this command was on the Tools menu and was called Formula Auditing. The descriptions in this book are for Excel 2002, Excel 2003, Excel 2007, and Excel 2010.

Formula auditing reduces the task to a few mouse clicks and shows the result (see Figure 3-26). Select the relevant formula cell and then the Tools/Formula Auditing/Trace Precedents option.

Tracer arrows show the flow of values and formula results in a worksheet. This allows you to find and view precedents (cells referenced in a formula) and dependents (cells with references to other cells).

The Formula Auditing toolbar in Excel 2003 (shown in Figure 3-26) was replaced with the Formula Auditing group on the Formulas tab in Excel 2007 and Excel 2010 (see Figure 3-27).

Assume that you want to find out which cells or cell results are included in the formula in a certain cell. The formula audit allows you to trace the flow of formulas and data. To do this, perform the following steps:

  1. Select the start cell for the audit. This cell can include a formula, or a formula might refer to the cell or contain an error message.

  2. In Excel 2003, select Formula Auditing from the Tools menu. In Excel 2007 and Excel 2010, select the Formulas tab to access the Formula Auditing options (shown earlier in Figure 3-27). The following options are available:

    • Trace Precedents. The first time you select this option, you see traces to all cells directly referenced in the formula. Select the option again to trace the next precedents level.

    • Trace Dependents. Select this option to display the traces to the cells that depend on the value or result in this cell. Select this option again to trace the next dependents level.

    • Trace Error. If the selected cell contains an error message, you can trace the cell causing the error. The traces to cells with errors are displayed in red. If the selected cell cannot be used with this command, the program shows a corresponding message.

    • Remove All Arrows (Excel 2007 and Excel 2010). This command removes all previous traces.

If the tracer arrow points to a formula, the line is blue and the cell ranges used in the formula have blue borders (see Figure 3-28).

The tracer line to an error is red. If a trace includes several errors, the formula audit stops, and you can chose the next action.

Excel 2003, Excel 2007, and Excel 2010 all mark each error in the worksheet with a green triangle in the upper-left corner (if you didn’t disable this option). If you select a cell with an error, the Caution symbol appears. The tooltip for this symbol shows the error message.

If a trace points to an external reference (for example, a table in the same workbook), the line is black.

If you prefer to work with a toolbar instead of commands, select the Formula Auditing option on the Tools menu and click Show Formula Auditing Toolbar (see Figure 3-29).

The buttons on the Formula Auditing toolbar and their tooltips, from left to right, are listed in Table 3-8.

Table 3-8. The Buttons on the Formula Auditing Toolbar

Button

Action

Trace Error

Excel starts the error audit to show all errors and their causes (see Figure 3-30 in the next section).

Trace Precedents

The traces from the selected cell to the precedents are marked. To trace additional precedent levels, click the button again.

Remove Arrows To Precedents

The tracer arrows to the precedent level are removed. If several precedent levels were traced, you have to click this button for each level.

Trace Dependents

The tracer arrows point to all formulas with references to the selected cell. Click again to show tracer arrows at the next level.

Remove Arrows To Dependents

The tracer arrows to the dependent level are removed. If several dependent levels were traced, you have to click this button for each level.

Remove All Arrows

All tracer arrows in the active sheet are removed.

Trace Error

Click this button to point tracer arrows to an error source.

New Comment

This button corresponds to the Paste/Comment menu option.

Circle Invalid Data

Cells or data that don’t meet the specified criteria are marked with a red oval.

Clear Validation Circles

Click this button to delete the validation circles. You can find more information about validation in Excel help.

Show Watch Window

You can watch the content of selected cells while searching for errors (see Figure 3-31 in the next section).

Evaluate Formula

Use this function to resolve formulas step by step. With this analysis process, you can quickly find errors.

In this example, the calculation results on a worksheet are not the expected results. You want to find out whether the data or the formulas contain errors. Select the error-checking option to start the validation. The dialog box for the first error found appears (see Figure 3-30). Select the next step.

Alternatively, select a cell that has a green triangle in its upper-left corner, and click the Caution symbol. Select the next step in the menu that appears.

Here’s another example: Several calculation steps based on each other don’t return the expected result. You want to watch all intermediate steps. To do this, perform the following steps:

If you don’t need this window, close it. If you open the window later, the window displays the watched cells again.

The evaluation of formulas is useful in checking for errors, because Excel allows you to resolve the formula step by step.

Select a formula cell and then select Formula Validation/Formula Evaluation. In the dialog box that appears, click the Step In or Step Out button to resolve the formula (see Figure 3-32). This way you can also find out whether your formula includes errors in reasoning not found by Excel.