Sub topic 7
What happens on copy, cut, insert, and delete
This chapter assumes you can enter and edit a basic formula, select ranges, and use copy and paste or the fill handle. It also assumes you know the three reference types: relative (B2), absolute ($B$2), and mixed ($B2 or B$2). Here you will see how each type behaves when cells are copied, cut, inserted, or deleted. These four operations look similar on screen, but Excel treats them in two different ways.
Two rules, not one
Excel adjusts references under two separate rules.
- Copying rewrites a formula. Excel reads each reference as an offset from the formula's own cell and rebuilds the formula at the new location. Dollar signs decide which parts of the offset stay fixed.
- Moving, inserting, and deleting keep a formula pointed at the same cell. Excel follows the cell that was moved, shifted, or removed. Dollar signs are ignored.
The most common misunderstanding is expecting $ to protect a reference during a cut or an insertion. It does not. The dollar sign only matters when a formula is copied or filled.
| Operation | Reference to a cell that moved or shifted | Does `$` matter? |
|---|---|---|
| Copy and paste, or fill | Rewritten relative to the new position | Yes |
| Cut and paste the formula | The formula's own references stay unchanged | No |
| Cut and paste a cell that others refer to | Those formulas follow the cell to its new address | No |
| Insert a row or column | References shift to keep pointing at the same cells | No |
| Delete a row or column | References to deleted cells become `#REF!` | No |
Copy and paste: offsets are rebuilt
Suppose C2 holds this formula:
C2: =A2*B2Excel does not store the text A2*B2. Internally it stores "the cell two columns to my left, same row" and "the cell one column to my left, same row". When you paste into C3, Excel rebuilds the formula from those offsets:
C3: =A3*B3Paste the same formula into F2, three columns to the right, and the references shift three columns:
F2: =D2*E2Copying works in both directions and in blocks. If you copy C2 and paste it over C3:C20, each cell gets its own rebuilt formula. You get the same result as dragging the fill handle.
Copy with a fixed input
Now consider a tax rate stored in E1.
D2: =B2*$E$1When you copy D2 down to D3, the relative B2 becomes B3, and the absolute $E$1 stays put:
D3: =B3*$E$1If you had written =B2*E1 instead, D3 would contain =B3*E2. E2 is probably empty, so Excel treats it as zero and the result is 0. This is the classic missing-dollar-sign error, and it is covered in more detail later in this tutorial.
Copy a mixed reference across and down
Mixed references fix one axis and let the other follow the copy. In a multiplication table with row headings in A2:A10 and column headings in B1:J1, one formula fills the whole grid:
B2: =$A2*B$1Copy it one column right to C2 and you get =$A2*C$1. The column of $A is locked, and the row of B$1 is locked. Copy it one row down to B3 and you get =$A3*B$1. The same formula works everywhere in the grid.
Pasting that does not rebuild
Normal paste copies the formula. A few paste options behave differently, and they are worth knowing.
- Paste Values keeps the result and drops the formula, so there are no references left to adjust.
- Paste Formulas keeps the formula but not the formatting. Reference adjustment is the same as a normal paste.
- Copying the formula text from the formula bar, then pasting it into a cell, copies the exact text. Nothing is rebuilt. This is a quick way to repeat a formula with identical references in a different cell.
To copy a formula so that its references do not change at all, you can also convert it to text temporarily. Select the cell, press F2 to enter edit mode, select the formula text with the mouse, copy it, press Esc, then paste into the target cell. The pasted formula has the same references as the original.
Copy a block of formulas
When you copy a block of cells that refer to each other, Excel preserves the internal relationships. Suppose C2 holds =A2+B2 and D2 holds =C2*2. Copy C2:D2 to C5:D5 and you get this:
C5: =A5+B5
D5: =C5*2D5 refers to C5, the formula that was pasted beside it, not to the original C2. Relative references inside a pasted block stay relative to the block. This is what you want in most cases. The surprise comes when a formula in the block refers to a cell outside the copied range. Because it is relative, it shifts along with the block and may end up pointing at the wrong cell. If that outside cell should stay fixed, anchor it.
Cut and paste: the formula keeps its references
Cutting differs from copying because the cells themselves are relocated, not duplicated. Excel makes two guarantees.
- A cut formula keeps its original references. If
C2holds=A2*B2and you cut it and paste it intoH10, the formula inH10is still=A2*B2. Excel does not rebuild it from offsets, since you moved the same formula and did not create a new one. - Formulas that refer to a cut cell follow it. If
D2holds=C2*2and you cutC2and paste it intoH10, thenD2becomes=H10*2.
Both rules apply whether the references are relative or absolute. If E1 holds a tax rate and D2 contains =B2*$E$1, cutting E1 to G1 changes D2 to =B2*$G$1. The dollar signs stay, and the target address updates.
This is useful. You can reorganize a sheet without breaking the formulas that depend on your inputs. It also explains a common surprise: cutting and pasting a formula does not make it adjust to its new row, so a formula moved from row 5 to row 12 still reads from the cells it read before.
Cutting a range
When you cut a whole range, any formula that referred to the entire range follows it. If F1 holds =SUM(B2:B10) and you cut B2:B10 into D2:D10, F1 becomes =SUM(D2:D10).
If you cut only part of a range, the formula does not stretch to include the moved part. Cut B5:B6 out of B2:B10 and paste it elsewhere. The formula =SUM(B2:B10) keeps pointing at B2:B10, which now contains two empty cells. The moved values are no longer in the sum. Excel tracks a range only when the entire range moves.
Drag and drop is a cut
Dragging a selection by its border to a new place is a move, so it follows the cut rules. Holding Ctrl while dragging makes it a copy, and it follows the copy rules.
Inserting rows and columns
Inserting a row or column shifts the cells below or to the right. Every reference that pointed at a shifted cell is updated to its new address, whether it is relative or absolute.
Suppose D2 holds =B2*$E$1, and you insert a new row above row 1. The rate moves from E1 to E2, and D2 (now in D3) becomes:
D3: =B3*$E$2The absolute reference followed the rate cell. This is the point of the rule: the dollar sign locks a reference against copy and fill, and it never locks against structural changes.
Ranges and insertion
What happens to a range depends on where you insert.
- Insert inside a range, between its first and last rows. The range grows.
=SUM(B2:B10)becomes=SUM(B2:B11)when you insert a row between rows 4 and 5. - Insert above the first row or below the last row. The range does not grow. It shifts if the insertion is above it, and stays the same if the insertion is below it.
The last case matters for running totals and monthly lists. If you add a new row directly under the last item, the new row is outside B2:B10, and your SUM misses it. Two common workarounds follow.
- Insert the new row above the last row of the range, then move the data.
- Convert the data to an Excel Table (
Ctrl+T) and refer to a column such asSales[Amount]. Table references grow automatically when you add rows.
An expanding range during insertion
The running-total pattern uses a range with a fixed start:
C2: =SUM($B$2:B2)
C3: =SUM($B$2:B3)If you insert a row above row 2, the anchored start shifts to $B$3 along with its data. If you insert a row between rows 2 and 3, the structure holds, and the new row gets no formula until you fill one in. The running-total column then has a gap, so copy the formula from the row above into the new row.
Deleting rows and columns
Deleting a row removes its cells. Formulas that referred to those cells cannot follow them, so Excel replaces the reference with #REF!.
Suppose D2 holds =B2*$E$1, and you delete column E. The formula becomes:
D2: =B2*#REF!The whole formula then returns #REF!, and so does every formula that depends on it. The error spreads down the chain.
Ranges behave differently from single-cell references.
- If you delete a row inside a range, the range shrinks.
=SUM(B2:B10)becomes=SUM(B2:B9)after you delete row 5. - If you delete the first or last row of a range, the range shrinks from that end. Deleting row 2 gives
=SUM(B2:B9), because the old row 3 becomes the new row 2. - If you delete every cell in the range, the formula returns
#REF!.
Clearing cell contents with the Delete key is not the same as deleting the cell. The key only removes the contents, so references still point at an empty cell that evaluates as zero. Nothing becomes #REF!, and the formula quietly uses zero. Both cases can cause wrong results, and the quiet one is harder to notice.
Undoing a `#REF!`
If #REF! appears right after a delete, press Ctrl+Z at once. Once you have saved, closed, or made many other changes, the original reference is gone from the formula, and you need to rebuild it by hand. Avoid a long chain of repair work by checking for #REF! before saving.
Worked example: a price sheet
Take a small sheet with these cells.
| Cell | Content |
|---|---|
| `A2:A4` | Item names |
| `B2:B4` | Net prices |
| `E1` | Tax rate, `0.2` |
| `C2:C4` | `=B2*$E$1` |
| `B6` | `=SUM(B2:B4)` |
| `C6` | `=SUM(C2:C4)` |
Walk through four edits.
- Copy
C2:C4toD2:D4.D2becomes=C2*$E$1. The relative part moved right, which is wrong here. This is a copy of the formulas, not of the intent. Use fill-down only along the direction the pattern runs. - Cut
E1and paste it intoG1. All three formulas inC2:C4become=B2*$G$1and so on. The totals still work. - Insert a row above row 3. The formulas shift,
B6becomesB7with=SUM(B2:B5), and the range grew because the insertion fell inside it. The new row 3 is empty until you add an item. - Delete column G. All formulas that read the tax rate now show
#REF!.
The same four edits, applied with the right habits (copy only along the pattern, cut for relocation, insert inside ranges, and never delete an input column without checking dependents), keep the sheet intact.
Finding what depends on a cell
Before you delete or cut, find out which formulas will be affected. Excel has built-in tools for this.
- Trace Dependents (Formulas tab) draws arrows from the selected cell to every formula that uses it.
- Trace Precedents shows the cells a formula reads from.
- Show Formulas (
Ctrl+the backtick key) displays every formula in the grid instead of its value, so you can compare references across a column. - Find (
Ctrl+F) with Look in: Formulas locates every formula containing a given address, such as$E$1.
Summary of behavior
- Copy and fill rebuild a formula from offsets. Dollar signs decide which parts stay fixed.
- Cut and drag keep a formula's own references, and update formulas that refer to the moved cell. Dollar signs do not matter.
- Insertion shifts references to stay on the same cells. A range grows only if you insert inside it.
- Deletion produces
#REF!for single-cell references, and shrinks ranges that lose only some of their cells. - Clearing contents is not deleting. References remain, and they read zero.
Exercise
Cell D2 holds =B2*$E$1, and E1 holds a tax rate. You cut E1 and paste it into G1. Then you insert a new row above row 1. What does D2 (now D3) contain, and why does the dollar sign not prevent the changes?
Show answer
After the cut, D2 holds =B2$G$1, because formulas that refer to a cut cell follow it to its new address. After inserting a row above row 1, the formula moves to D3 and becomes =B3$G$2, because the rate cell and the formula both shifted down by one row. The dollar sign only locks a reference when a formula is copied or filled. Cut, insert, and delete track the cells themselves, so the dollar sign has no effect.
Exercise
A total in F1 is =SUM(B2:B10). You add a new item in B11, directly below the range. The total does not change. Give two ways to prevent this problem in the future.
Show answer
A new row below the last row is outside the range, so the range does not grow. First, insert new rows inside the range, for example above the last item, so Excel expands the range. Second, convert the data to an Excel Table with Ctrl+T and use a structured reference such as Sales[Amount], which grows automatically when rows are added.
Exercise
You copy C2, which holds =A2*B2, and paste it into F5. What does F5 contain? Then you cut C2 instead and paste it into F5. What does F5 contain now?
Show answer
The copy rebuilds the formula from offsets. C2 refers to two columns left and one column left in the same row, so F5 becomes =D5E5. The cut keeps the formula's own references, so F5 contains =A2B2.