edubun
English
1 / 20

5 / 6 · Intro

Copying formulas: relative references

Copy =B4*C4 from D4 to D5 and it arrives as =B5*C5. Microsoft uses this exact example to explain relative references.

Jump to the 10 practice questions

You will learn

  • Predict how a relative reference changes when copied
  • Fill a formula down or across
  • Recognise #REF! from a reference that falls off the edge

Before this: Adding up with SUM

1Explain

References remember a direction

Write a formula once, then copy it down a column, and it works on every row. This is possible because an ordinary reference is relative. Microsoft explains it with A2 seen from C2: the reference really means "the cell two columns to the left, in the same row". Copy the formula somewhere else and it still means two columns to the left of wherever it now sits. So =B4*C4 in D4, which means "the two cells to my left", becomes =B5*C5 when copied to D5.

2Problem

What a relative reference stores

What does a relative reference really store?

Hint

A direction from the formula.

Solution

Answer: A position relative to the formula's cell

For example, "two columns left, same row".

3Explain

Arithmetic on the address

The rule is simple arithmetic on the address. Move the formula down by some rows and every row number in it grows by the same amount. Move it right by some columns and every column letter moves the same number of letters. Microsoft's table copies =A1 two cells down and two cells to the right and gets =C3. Copying =A2+1 from B2 up to B1 gives =A1+1. Nothing about the formula's meaning changes, only where it looks.

Formulas shown instead of results. One formula in D2, filled down to D6, changes its row numbers on every row.

4Explore

Moving a reference

Copying adds the same number of rows and columns to every relative reference. Going past row 1 or column A gives #REF!.

Reference
Rows down
Columns right
const colNum = (s) => [...s].reduce((n, ch) => n * 26 + ch.charCodeAt(0) - 64, 0);
const colName = (n) => (n > 26 ? colName(Math.floor((n - 1) / 26)) : "") + String.fromCharCode(65 + ((n - 1) % 26));
const ref = "A1", down = 2, right = 2;
const col = colNum(ref.match(/[A-Z]+/)[0]) + right;
const row = Number(ref.match(/\d+/)[0]) + down;
console.log(col < 1 || row < 1 ? "#REF!" : colName(col) + row);
Output
C3

5Problem

D4 to D5

=B4*C4 in D4 is copied to D5. What formula is in D5?

Hint

One row down.

Solution

Answer: =B5*C5

One row down: both row numbers grow by 1.

6Problem

Two down, two right

=A1 is copied two cells down and two cells to the right. What does it become?

Hint

A → C, 1 → 3.

Solution

Answer: =C3

Moving two columns right changes A to C, and moving two rows down changes 1 to 3, giving C3.

7Problem

B2 to B1

=A2+1 in B2 is copied to B1. What formula is in B1?

Hint

One row up.

Solution

Answer: =A1+1

One row up: the row number goes down by 1.

8Problem

D2 to E2

=B2*C2 in D2 is copied one column right, to E2. What does it become?

Hint

One column right: B → C, C → D.

Solution

Answer: =C2*D2

One column right: B becomes C and C becomes D.

9Problem

SUM across

=SUM(B2:B4) in B5 is copied to C5. What does it become?

Hint

The range moves one column too.

Solution

Answer: =SUM(C2:C4)

Both ends of the range move one column right.

10Explain

Three ways to copy

You can copy and paste the cell as usual. You can drag the small square at the bottom-right corner of the selected cell, called the fill handle, down or across. Or you can select the formula together with the empty cells below it and press Ctrl+D to fill down, or select it with the cells to its right and press Ctrl+R to fill right. Google's shortcut list gives Ctrl+D and Ctrl+R for Sheets (⌘+D and ⌘+R on a Mac), and Excel on Windows uses the same keys.

11Problem

Ctrl+D

What does Ctrl+D do in Google Sheets?

Hint

D for down.

Solution

Answer: Fill down

Google's shortcut list: Ctrl+D fill down, Ctrl+R fill right.

12Explain

Show the formulas

To see what actually happened, show the formulas instead of the results. Google Sheets does this with Ctrl+~ according to its shortcut list, and Excel has a Show Formulas button on the Formulas tab. Reading a column of formulas side by side is the quickest way to spot the one row that does not follow the pattern, for example a cell where someone typed a number over the formula.

13Problem

Showing formulas

Which shortcut shows all formulas in Google Sheets?

Hint

The key with the wavy line.

Solution

Answer: Ctrl+~

"Show all formulas: Ctrl + ~" in Google's list. Excel has a Show Formulas button on the Formulas tab.

14Explain

Values do not move

Copying only moves the references, not the values. A formula may refer to a cell that is meant to stay put, such as a tax rate in one cell at the top. A relative reference will slide away from it as you fill down. The results will be wrong without any error showing. That problem has its own fix, the absolute reference, which opens the Formulas course.

15Explain

Falling off the edge

A relative reference can be pushed somewhere that does not exist. Copy =A1+1 from B1 one column left into A1 and the reference would have to point left of column A. There is nothing there, so the program writes #REF! into the formula itself, and the cell shows the #REF! error. The same thing happens when you copy a formula that looks one row up into row 1. When a copied formula suddenly shows #REF!, show formulas and check which reference ran off the sheet.

16Problem

Left of column A

=A1+1 in B1 is copied into A1. What happens?

Hint

There is nothing there.

Solution

Answer: The reference becomes #REF!

It would need a column left of A, which does not exist.

17Explore

Practice in the grid

Loading

Drag to turn. Scroll or pinch to zoom.

Select D2, then Shift+click D6 (or press Select range and tap D6), and press Fill down. Turn on Show formulas to see each row's own references. Try copying D2 and pasting it into A2 to see #REF! appear.

18Problem

D5 after filling

After filling =B2*C2 from D2 to D6, B5 is 4.25 and C5 is 2. What is in D5?

Hint

4.25 × 2.

Solution

Answer: 8.5

D5 holds =B5*C5 = 4.25 × 2 = 8.5.

19Practice

Write the shift function

colNum and colName are given. Finish shift(ref, down, right): return the moved address, or "#REF!" when it would fall above row 1 or left of column A.

Expected output
C3
B5
C2
A1
#REF!
Your code
const colNum = (s) => [...s].reduce((n, ch) => n * 26 + ch.charCodeAt(0) - 64, 0);
const colName = (n) => (n > 26 ? colName(Math.floor((n - 1) / 26)) : "") + String.fromCharCode(65 + ((n - 1) % 26));
function shift(ref, down, right) {
  const col = colNum(ref.match(/[A-Z]+/)[0]) + right;
  const row = Number(ref.match(/\d+/)[0]) + down;
  return ref;
}
console.log(shift("A1", 2, 2));
console.log(shift("B4", 1, 0));
console.log(shift("B2", 0, 1));
console.log(shift("A2", -1, 0));
console.log(shift("A1", 0, -1));
Hint

Column 1 is A and row 1 is the first row; anything below 1 does not exist.

A solution
const colNum = (s) => [...s].reduce((n, ch) => n * 26 + ch.charCodeAt(0) - 64, 0);
const colName = (n) => (n > 26 ? colName(Math.floor((n - 1) / 26)) : "") + String.fromCharCode(65 + ((n - 1) % 26));
function shift(ref, down, right) {
  const col = colNum(ref.match(/[A-Z]+/)[0]) + right;
  const row = Number(ref.match(/\d+/)[0]) + down;
  if (col < 1 || row < 1) return "#REF!";
  return colName(col) + row;
}
console.log(shift("A1", 2, 2));
console.log(shift("B4", 1, 0));
console.log(shift("B2", 0, 1));
console.log(shift("A2", -1, 0));
console.log(shift("A1", 0, -1));

20

Summary

  • Ordinary references are relative: they shift when the formula is copied.
  • Down n rows: row numbers + n. Right n columns: letters move n.
  • Fill with the fill handle, or Ctrl+D (down) and Ctrl+R (right).
  • A reference pushed off the sheet becomes #REF!.

Next unitReading error values
Full text · The whole lesson as one text

References remember a direction

Write a formula once, then copy it down a column, and it works on every row. This is possible because an ordinary reference is relative. Microsoft explains it with A2 seen from C2: the reference really means "the cell two columns to the left, in the same row". Copy the formula somewhere else and it still means two columns to the left of wherever it now sits. So =B4*C4 in D4, which means "the two cells to my left", becomes =B5*C5 when copied to D5.

The rule is simple arithmetic on the address. Move the formula down by some rows and every row number in it grows by the same amount. Move it right by some columns and every column letter moves the same number of letters. Microsoft's table copies =A1 two cells down and two cells to the right and gets =C3. Copying =A2+1 from B2 up to B1 gives =A1+1. Nothing about the formula's meaning changes, only where it looks.

Formulas shown instead of results. One formula in D2, filled down to D6, changes its row numbers on every row.

Three ways to copy

You can copy and paste the cell as usual. You can drag the small square at the bottom-right corner of the selected cell, called the fill handle, down or across. Or you can select the formula together with the empty cells below it and press Ctrl+D to fill down, or select it with the cells to its right and press Ctrl+R to fill right. Google's shortcut list gives Ctrl+D and Ctrl+R for Sheets (⌘+D and ⌘+R on a Mac), and Excel on Windows uses the same keys. The lab has buttons for these, plus a Select range button for touch screens.

To see what actually happened, show the formulas instead of the results. Google Sheets does this with Ctrl+~ according to its shortcut list, and Excel has a Show Formulas button on the Formulas tab. Reading a column of formulas side by side is the quickest way to spot the one row that does not follow the pattern, for example a cell where someone typed a number over the formula.

Copying only moves the references, not the values. A formula may refer to a cell that is meant to stay put, such as a tax rate in one cell at the top. A relative reference will slide away from it as you fill down. The results will be wrong without any error showing. That problem has its own fix, the absolute reference, which opens the Formulas course.

Falling off the edge

A relative reference can be pushed somewhere that does not exist. Copy =A1+1 from B1 one column left into A1 and the reference would have to point left of column A. There is nothing there, so the program writes #REF! into the formula itself, and the cell shows the #REF! error. The same thing happens when you copy a formula that looks one row up into row 1. When a copied formula suddenly shows #REF!, show formulas and check which reference ran off the sheet. The next course shows how a dollar sign stops a reference from moving at all.

Select D2, then Shift+click D6 (or press Select range and tap D6), and press Fill down. Turn on Show formulas to see each row's own references. Try copying D2 and pasting it into A2 to see #REF! appear.
Key points
  • Ordinary references are relative: they shift when the formula is copied.
  • Down n rows: row numbers + n. Right n columns: letters move n.
  • Fill with the fill handle, or Ctrl+D (down) and Ctrl+R (right).
  • A reference pushed off the sheet becomes #REF!.

Practice questions from Copying formulas: relative references on edubun

Embed this quiz

Free to embed. Please keep the credit line.

Sources for this course (15)
  • Microsoft Support, "Excel specifications and limits" (support.microsoft.com/en-us/office/excel-specifications-and-limits-1672b34d-7043-467e-8e27-269d656771c3: 1,048,576 rows by 16,384 columns, 15-digit precision, 255 arguments)
  • "Calculation operators and precedence in Excel" (.../calculation-operators-and-precedence-in-excel-48be406d-4975-4d31-b2b8-7af9e0e2878a: operators, order negation % ^ * / + - & comparisons, =5+2*3 is 11, ="1"+"2" is 3, ="A"&TRUE is ATRUE, #### for too little space)
  • "SUM function" (.../sum-function-043e1c7d-7726-4e80-8f32-07b23e057f89: up to 255 numbers, =A1+B1+C1 gives #VALUE! with text while SUM ignores text)
  • "Switch between relative, absolute, and mixed references" (.../dfec08cd-ae65-4f56-839e-5f0d8d0baca9: =B4*C4 copied from D4 to D5 becomes =B5*C5)
  • "Date systems in Excel" (.../e7fe7167-48a9-4b96-bb53-5612a800b487: July 5, 2011 is 40729 in the 1900 system and 39267 in the 1904 system, 1,462 days apart)
  • "Remove or allow a circular reference" (.../8540bd0f-6e97-4483-bcf7-1b49cd50d123: warning, then 0 or the last value)
  • VLOOKUP and IF pages (#N/A, #NAME? from missing quotes)
  • Google Docs Editors Help: SUM (support.google.com/docs/answer/3093669: any number of arguments)
  • DATE (answer/3092969: days counted from December 30, 1899)
  • Keyboard shortcuts for Google Sheets (answer/181110: Ctrl+D fill down, Ctrl+R fill right, Ctrl+~ show all formulas, F4 absolute/relative)
  • Files you can store in Google Drive (support.google.com/drive/answer/37603: up to 20 million cells per spreadsheet)
  • ERROR.TYPE (answer/3238305: the error values)
  • History: Smithsonian National Museum of American History, VisiCalc software and documentation, object nmah_1696121 (Bricklin and Frankston, Apple II, 1979)
  • ACM Interactions, "The first killer app: a history of spreadsheets" (2013: Lotus 1-2-3, Excel for the Macintosh in 1985)
  • Wikipedia, VisiCalc and Lotus 1-2-3 (VisiCalc used A1 notation; Lotus 1-2-3 launched 1983).

Checked: 2026-10-17