Relative Cell References: Example 1

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

CELL REFERENCING STYLES IN EXCEL

Introduction

There are two types of cell references: relative and absolute. Relative and absolute references behave
differently when copied and filled to other cells. Relative references change when a formula is copied
to another cell. Absolute references, on the other hand, remain constant, no matter where they are
copied.

Relative cell references


This is the standard type of reference. Look at the following examples:
By default, all cell references are relative references. When copied across multiple cells, they change based on
the relative position of rows and columns. For example, if you copy the formula =A1+B1 from row 1 to row 2,
the formula will become =A2+B2. Relative references are especially convenient whenever you need to repeat
the same calculation across multiple rows or columns.

Example 1:

If cell A1 contains value 2, and cell B1 contains formula =A1+2 (referring to cell A1), then the
formula B1 contains value 4. If you change the value in cell A1 to 5, then the value in
cell B1 automatically changes to 7.
Example 2:

If cell B1 refers to cell A1, then after copying cell B1 to cell D2, the cell starts to refer to cell C2. In
other words, cell reference has been moved by the same distance as the copied cell.
Example 3:

Look at the following example. Here, you can find the names of employees of a fictional company.

If you want to merge the first name with the last name and place them in column D, you don't have to
enter them manually, but you can merge them by using the relative references, instead.
In this case, enter the formula =B2&" "&C2 into cell D2. It will merge cell B2, space, and cell C2.
Now you can use AutoFill to fill the remaining cells.

You can display formulas instead of values by using the Ctrl + ` (the key that is located below the ESC
key) keyboard shortcut.

As you can see, only the formula in cell D2 refers to cells B2 and C2. References in the next cells have
been shifted accordingly.

Absolute cell references


There may be times when you do not want a cell reference to change when filling cells. Unlike relative
references, absolute references do not change when copied or filled. You can use an absolute
reference to keep a row and/or column constant.
An absolute reference is designated in a formula by the addition of a dollar sign ($). It can precede the
column reference, the row reference, or both.

Absolute cell reference always points to the same place, even if you change the position of any of
those cells. In other words, if you have cell A1 which refers to the contents of cell B1 (=$B$1) and
then you change the position of A1 it will still refer to cell B1. If you drag cell B1 to another location,
for example, B3, then A1 will point to the new location of the same cell (=$B$3).
Example 4:

Look at the following example: it shows the earnings of Tom Smith. We need to calculate how much
tax he need to pay each month.

Look at the formula bar. It shows how much tax John needs to pay for January (=C3*D7). If you want
to automatically fill the remaining months, you will notice that for February the reference doesn't point
to cell D7, instead it points to cell D8, and for March to cell D9.
To create an absolute reference, click cell D3, then in the formula click text D7. Now press the F4
key and confirm it by pressing Enter. This will change a relative reference to an absolute reference.

Use AutoFill to count the taxes for February, March, then sum all the months. Press Ctrl + ` to display
the formula.

As you can see in the example above in all four cells, the first part of the formula is a relative cell
reference and the second part is an absolute cell reference.

Mixed cell references


Mixed references are when either the row or column is anchored.

For example, $A1 or A$1. If you want to create a mixed reference- press the F4 key on the formula
bar two or three times depending on whether you want to refer to row or column. Press F4 one more
time to go back to the relative cell reference.
For example, suppose you are a farmer making a budget. You also own a feed store and sell seeds. You
are going to plant corn, soybeans, and alfalfa. The spreadsheet below shows the cost per acre. The
cost per acre = price per pound * pounds of seeds per acre thats what it will cost you to plant
an acre.
Enter the cost per acre as =$B2 * C2 in cell D2. You are saying you want to anchor the price per pound
column. Then copy that formula to the other rows in the same column:

Now you want to know the value of your inventory of seeds. You need the price per pound and the
number of pounds in inventory to know the value of the inventory.
We add two columns: pound of seed in inventory and then value of inventory. Now, copy the cell
D2 to F4 and note that the row reference in the first part of the original formula ($B2) is updated to
row 4 but the column remains fixed because the $ anchors it to B.

This is a mixed reference because the column is absolute and the row is relative.

Using cell references with multiple worksheets

Excel allows you to refer to any cell on any worksheet, which can be especially helpful if you want to
reference a specific value from one worksheet to another. To do this, you'll simply need to begin the
cell reference with the worksheet name followed by an exclamation point (!). For example, if you
wanted to reference cell A1 on Sheet1, its cell reference would be Sheet1!A1.
Note that if a worksheet name contains a space, you will need to include single quotation marks (' ')
around the name. For example, if you wanted to reference cell A1 on a worksheet named July Budget,
its cell reference would be 'July Budget'!A1.
To reference cells across worksheets:

In our example below, we'll refer to a cell with a calculated value between two worksheets. This will
allow us to use the exact same value on two different worksheets without rewriting the formula or
copying data between worksheets.
1. Locate the cell you want to reference, and note its worksheet. In our example, we want to reference cell
E14 on the Menu Order worksheet.

1. Navigate to the desired worksheet. In our example, we'll select the Catering Invoice
worksheet.

2. The selected worksheet will appear.


3. Locate and select the cell where you want the value to appear. In our example, we'll select cell
B2.

4. Type the equals sign (=), the sheet name followed by an exclamation point (!), and the cell
address. In our example, we'll type ='Menu Order'!E14.

5. Press Enter on your keyboard. The value of the referenced cell will appear. If the value of cell
E14 changes on the Menu Order worksheet, it will be updated automatically on the Catering
Invoice worksheet.

If you rename your worksheet at a later point, the cell reference will be updated automatically to
reflect the new worksheet name.
If you enter a worksheet name incorrectly, the #REF! error will appear in the cell. In our example
below, we've mistyped the name of the worksheet. Click the Error button
option from the drop-down menu to edit or ignore the error.

and select the desired

You might also like