Sub topic 2
Copying and Filling Formulas
This chapter covers how Google Sheets copies and fills formulas, and what happens to the cell references inside them. It assumes you can enter values and formulas in a cell, you know addresses such as A1 and B2, and you can use basic operators such as +, -, * and /. Later chapters explain relative, absolute and mixed references in detail. Here the focus is the copying methods themselves, so you can predict what each one does.
Why copying matters
A spreadsheet is useful when you write a formula once and reuse it on many rows. Typing =A2*0.2 by hand into 500 rows would be slow and error-prone. Sheets gives you several ways to copy a formula, and each one adjusts the references inside it. You need to know the rule behind that adjustment to trust the results.
The core rule: formulas move by offset
When you copy a formula, Sheets does not copy the text letter for letter. It stores each reference as a position relative to the formula's own cell, and it rebuilds the references at the destination.
Suppose B2 contains =A2*0.2. Sheets reads this as "multiply the cell one column to the left, in the same row, by 0.2". If you copy the formula to B3, the same description applies, so the formula becomes =A3*0.2.
Cell B2: =A2*0.2
Cell B3 (after fill down): =A3*0.2The shift equals the distance between the source and the destination:
| Move from B2 to | Rows moved | Columns moved | Resulting formula |
|---|---|---|---|
| B3 | +1 | 0 | `=A3*0.2` |
| B10 | +8 | 0 | `=A10*0.2` |
| C2 | 0 | +1 | `=B2*0.2` |
| D5 | +3 | +2 | `=C5*0.2` |
This is the default behavior for references written without dollar signs. The next chapters show how to override it. For now, remember that the default is "shift by the same offset as the formula".
Method 1: The fill handle
The fill handle is the small square at the bottom-right corner of the selected cell or range. When you hover over it, the pointer turns into a crosshair.
To fill a formula down a column:
- Click the cell that holds the formula, for example B2.
- Hover over the small square in the bottom-right corner until the pointer becomes a crosshair.
- Drag down to the last row you need, for example B20.
- Release the mouse button.
Sheets writes an adjusted formula into every cell you dragged across. You can also drag right or left, and the formula adjusts by columns in the same way.
What the fill handle does with values
The fill handle also continues patterns in plain values. If you select two cells containing 1 and 2 and drag, Sheets continues with 3, 4, 5. If you select one cell containing 5 and drag, Sheets copies 5. Formulas follow the offset rule from the previous section, regardless of pattern detection.
Method 2: Double-click autofill
Dragging down 2,000 rows is awkward. Instead, double-click the fill handle. Sheets fills the formula down as far as the neighboring column has data.
Autofill decides where to stop by looking at the column next to the formula. For example, if A2:A400 holds prices and B2 holds your formula, double-clicking the fill handle in B2 fills B2:B400.
Edge cases to watch for:
- Blank cells in the neighboring column. If A has a gap at A150, autofill can stop at A149. Check the last filled row.
- No neighbor data. If both adjacent columns are empty, double-click does nothing useful. Drag manually instead.
- Data on the wrong side. Sheets looks at the adjacent column that contains data. If the column to the left is empty and the one to the right has data, the result can still follow the right-hand column. Always scroll to the end and confirm.
- Totals below the list. A total row directly under the data can be treated as part of the list, so verify that the formula did not overwrite or extend into the total.
Method 3: Copy and paste
Copy and paste is the most flexible method, because the destination does not have to be next to the source.
- Select the cell with the formula and press Ctrl+C (Cmd+C on Mac).
- Select the destination cell or range.
- Press Ctrl+V (Cmd+V on Mac).
If you select a single formula cell and paste into a larger range, Sheets repeats the formula in every cell of that range, each adjusted by its own offset. This is a fast way to fill a block such as C2:F100 in one step.
Paste special options
Normal paste copies the formula, formatting, and validation. The right-click menu offers Paste special, with options that matter when copying formulas:
| Option | What it pastes | When to use it |
|---|---|---|
| Paste all | Formula, formatting, validation | Default copy of a formula |
| Paste values only | The calculated result, with no formula | Freezing a result so it stops changing |
| Paste formula only | The formula without formatting | Keeping the destination's look |
| Paste format only | Formatting only | Matching styles after filling |
Paste values only is the usual way to convert a formula into a fixed number. After this, the cell no longer updates, and the references inside no longer matter.
Method 4: Keyboard shortcuts for filling
Two shortcuts fill from the cell above or to the left without using the mouse:
- Ctrl+D fills down. Select a range whose top cell holds the formula, then press Ctrl+D. Every other cell in the selection receives an adjusted copy.
- Ctrl+R fills right. Select a range whose leftmost cell holds the formula, then press Ctrl+R.
On Mac, use Cmd instead of Ctrl. These shortcuts are efficient when you select a large range by clicking the first cell and then Shift+clicking the last one.
Method 5: Cut and paste is different
Cut and paste (Ctrl+X, then Ctrl+V) moves a formula instead of copying it. This behaves differently from copying. A moved formula keeps pointing at the same cells it did before, and its references do not shift. If B2 holds =A2*0.2 and you cut it to D10, the formula in D10 still reads =A2*0.2.
Likewise, if you cut a cell that other formulas refer to, those formulas follow it to the new location. This is why cutting is safe for rearranging a sheet, while copying is the way to repeat a calculation.
| Action | Does the formula text adjust? | Do other formulas pointing to the source follow it? |
|---|---|---|
| Copy and paste | Yes, by offset | No, they keep pointing at the original |
| Cut and paste | No, it keeps its references | Yes, they now point to the new location |
| Fill handle or Ctrl+D | Yes, by offset | No |
Seeing the formulas you copied
After filling, confirm what Sheets produced. There are two reliable ways to inspect it.
- Click a cell and read the formula in the formula bar. Check the first, middle and last filled cells.
- Show all formulas. Use View > Show > Formulas, or press Ctrl+` (the backtick key). Every cell then displays its formula text instead of its result. Press the shortcut again to switch back.
Checking three or four cells takes seconds and catches most problems.
A worked example: filling a price list
You have prices in A2:A6 and want a 20 percent tax amount beside each one.
| Row | A | B |
|---|---|---|
| 1 | Price | Tax |
| 2 | 10 | |
| 3 | 25 | |
| 4 | 40 | |
| 5 | 8 | |
| 6 | 15 |
- Click B2 and type
=A2*0.2, then press Enter. - Click B2 again.
- Double-click the fill handle at its bottom-right corner.
- Sheets fills B3:B6.
Now check B4 in the formula bar. It reads =A4*0.2. Each row uses its own price, which is the result you want.
The same formula can use a cell holding the tax rate instead of the typed number 0.2. That is the case where the default behavior causes trouble, because the rate cell would shift too. The next chapters cover how to lock it.
Common problems when copying
- A formula returns the same value on every row. The reference may be locked when it should shift. Check for
$signs in the formula bar. - A formula returns zero or an empty-looking result. A reference may have shifted onto an empty cell. Click the cell and see where it points.
- Autofill stops early. The neighboring column has a gap. Fill the missing rows by dragging or with Ctrl+D.
- The numbers look right but never update. You may have used Paste values only, which removes the formula.
- References point above row 1 or left of column A. Copying a formula so that a reference would move off the sheet produces a
#REF!error. This happens when you copy=A1*2from B1 to a spot that would need column left of A or row above 1.
Practice
Exercise
Cell C3 contains =B3+10. You copy it to E6. What formula does E6 contain, and why?
Show answer
E6 contains =D6+10. The move from C3 to E6 is 2 columns right and 3 rows down. The reference B3 shifts by the same offset, so it becomes D6.
Exercise
Cell D2 contains =B2*C2. You cut it and paste it into F8. What formula does F8 contain?
Show answer
F8 still contains =B2*C2. Cut and paste moves the formula without adjusting its references, unlike copy and paste.
Exercise
A2:A400 holds prices, and B2 holds a formula. You double-click the fill handle in B2, but only B2:B149 fills. What is the most likely cause, and how do you fix it?
Show answer
The neighboring column probably has a blank cell at A150, and autofill stops at the first gap. Fill the rest by selecting B149 through B400 and pressing Ctrl+D, or by dragging the fill handle to the last row.