Copying and pasting data from one workbook to another is a quick
and easy way to gather related data in one place, but there is a
substantial limitation: If the data from the original cell changes, the
change is not reflected in the cell to which the data was copied. In
other words, copying and pasting a cell’s contents doesn’t create a
relationship between the original cell and the target cell.
You can ensure that the data in the target cell reflects
any changes in the original cell by creating a link between the two
cells. Instead of entering a value into the target cell by typing or
pasting, you create a formula that identifies the source from which
Excel will derive the target cell’s value and updates the value when it
changes in the source cell.
To create a link between cells, open both the workbook that
contains the cell from which you want to pull the value and the workbook
with the target cell. Then click the target cell and type an equal sign,
signifying that you want to create a formula. After you type the equal
sign, activate the workbook with the cell from which you want to derive
the value, click that cell, and then press the Enter key.
When you switch back to the workbook with the target cell, you see
that Excel has filled in the formula with a reference to the cell you
clicked.
For example, the reference
=’[FleetOperatingCosts.xlsx]Truck Fuel’!$C$15 gives
three pieces of information: the workbook, the worksheet, and the cell
you clicked in the worksheet. The first element of the reference, the
name of the workbook, is enclosed in square brackets; the end of the
second element (the worksheet) is marked with an exclamation point; and
the third element, the cell reference, has a dollar sign before both the
row and the column identifier. The single quotes around the workbook
name and worksheet name are there to account for the space in the Truck
Fuel worksheet’s name. This type of reference is known as a
3-D reference, reflecting the three dimensions
(workbook, worksheet, and cell range) that you need to point to a group
of cells in another workbook.
Tip
For references to cells in the same workbook, the
workbook information is omitted. Likewise, references to cells in the
same worksheet don’t use a worksheet identifier.
You can also link to cells in an Excel table. Such links include
the workbook name, worksheet name, name of the Excel table, and row and
column references of the cell to which you’ve linked. Creating a link to
the Cost column’s cell in a table’s Totals row, for example, results in
a reference such as =‘FleetOperatingCosts.xlsx’!Truck
Maintenance[[#Totals],[Cost]].
Important
Hiding or displaying a table’s Totals row affects any links to a
cell in that row. Hiding the Totals row causes references to that row
to display a #REF! error message.
Whenever you open a workbook containing a link to another
document, Excel tries to update the information in linked cells. If the
program can’t find the source, as would happen if a workbook or
worksheet is deleted or renamed, an alert box appears to indicate that
there is a broken link. At that point, you can click the Update button
and then the Edit Links button to open the Edit Links dialog box and
find which link is broken. After you identify the broken link, you can
close the Edit Links dialog box, click the cell containing the broken
link, and create a new link to the desired data.
If you type a link and you make an error, a
#REF! error message appears in the cell that
contains the link. To fix the link, click the cell, delete its contents,
and then either retype the link or create it with the point-and-click
method described earlier in this section.
Tip
Excel tracks workbook changes, such as when you change a
workbook’s name, very well. Unless you delete a worksheet or workbook,
or move a workbook to a new folder, odds are good that Excel can
update your link references automatically to reflect the
change.
In this exercise, you’ll create a link to another workbook, make
the link’s reference invalid, use the Edit Links dialog box to break the
link, and then re-create the link correctly.
Set Up
Open the
OperatingExpenseDashboard_start and FleetOperatingCosts_start
workbooks, and save them as
OperatingExpenseDashboard and
FleetOperatingCosts, respectively. Then follow
the steps.
-
In the OperatingExpenseDashboard workbook, in cell
I6, type =, but do not press Enter.
-
On the View tab, in the
Window group, click Switch Windows and then, in the list, click
FleetOperatingCosts.
The FleetOperatingCosts workbook is displayed.
-
If necessary, click the Plane
Repair sheet tab to display the Plane Repair worksheet,
and then click cell C15.
Excel sets the cell’s formula to
=’[FleetOperatingCosts.xlsx]Plane
Repair’!$C$15.
-
Press Enter.
Excel displays the OperatingExpenseDashboard workbook; the
value $2,410,871 appears in cell I6.
Tip
Yes, cell C15 on the Plane Repair worksheet contains the
wrong total for the Airplane Fuel category; that’s why you replace
it later in this exercise.
-
In the Switch Windows list,
click FleetOperatingCosts.
The FleetOperatingCosts workbook is displayed.
-
Right-click the Plane
Repair sheet tab, and then click Delete. In the message box that appears,
click Delete to confirm that you
want to delete the worksheet.
Excel deletes the Plane Repair worksheet.
-
In the Switch Windows list,
click OperatingExpenseDashboard.
The OperatingExpenseDashboard workbook is displayed, showing a
#REF! error in cell I6.
-
On the Data tab, in
the Connections group, click
Edit Links.
The Edit Links dialog box opens.
-
Click Break Link.
Excel displays a warning box asking if you’re sure you want to
break the link.
-
Click Break Links.
The warning box closes, and Excel removes the link from the
workbook.
-
Click Close.
The Edit Links dialog box closes.
-
In cell I6, type =, but do not press Enter.
-
In the Switch Windows list,
click FleetOperatingCosts.
The FleetOperatingCosts workbook is displayed.
-
Click the Plane Fuel sheet
tab.
The Plane Fuel worksheet is displayed.
-
Click cell C15, and then
press Enter.
Excel displays the OperatingExpenseDashboard workbook with the
value $52,466,303 in cell I6.
Clean Up
Save the OperatingExpenseDashboard and FleetOperatingCosts
workbooks, and then close them.