Relative referencing

To avoid the aforementioned shortcomings, you should enter the cell references of the cells containing the values, rather than typing the actual values, as shown in the following screenshot:

The formula bar in the preceding screenshot shows that we entered F5*I5.

In this way, it is clear where the input is coming from. All the cells that have formulas that refer to those cells will be automatically updated.

Another advantage of referencing is that, by default, Excel registers the position of the cell references relative to the active cell. So, in the preceding example, F5 is registered as four cells to the left, and I5 is registered as one cell to the left of the active cell, J5.

The relevance of this is that, when you copy that formula to another location, Excel remembers the positions of the original cell references included in the formula, relative to the original active cell. Excel then adjusts the references accordingly in order to maintain those positions relative to the new active cell.

So, if the formula is copied 15 cells down, the row part of the reference is adjusted by 15 rows down, and so F5*I5 automatically becomes F20*I20. In this way, since the formula is the same, that is, Units Sold × Unit Cost, we can simply copy our formula down the list and still obtain the correct answers. This can be seen in the following screenshot:

This wouldn't work in the example we saw in the previous section, where we entered the values directly into the active cell. If we copied down in that case, we would get the same value, 1,950,000, all the way down the list.

This technique of referencing the cells, instead of their actual values, is called relative referencing.

There are several different ways to copy to a range of cells, which are as follows:

If you press Ctrl + V, Excel places a Ctrl icon at the bottom right of the last cell of the range. You can then click on the icon or simply press Ctrl and a box of Paste Special options will appear, as shown in the following screenshot:

You can then select, paste format, paste values, transpose, or perform any one of the other options.

This feature isn't available if you press Enter to paste.

However, the cells in the adjacent column, left or right, must be populated in order to indicate to Excel how far down you wish to fill the formula.