Excel Formula References: Why Copying Formulas Sometimes Goes Wrong
Have you ever copied a formula to another tab in your workbook, and the result was not at all what you expected? Moved a formula to a new location and were surprised that it didn’t change?
References in Excel work just as you would expect in most situations; but to understand how to fix the problem formulas, you need to know a little bit about how Excel formula references work in the Excel environment.
Relative References
“Relative reference” means that the formula changes when you copy it to another cell. In other words, the reference is relative to the location of the formula.
Try it. In cell A1, enter “20”; and in cell A2, enter “30”. In cell B1, enter the formula “=A1+1”.
Now copy the formula in cell B1:
- Click on cell B1.
- Click the Copy button. The selection rectangle surrounding B1 will change to moving dashes.
- Select cell B2.
- Click the Paste button.
Now examine the formula in B2, and you’ll find that, instead of “=A1+1”, it shows “=A2+1”. The reference to A1 has changed to refer to A2. This is how a relative reference behaves. Wherever you copy this formula, you’ll find that it operates similarly, always referring to the cell directly to the left of the formula.
Absolute References
Excel defaults to relative references because that’s what you’ll need more often than not, yet sometimes you want a formula always to point to the original source. You can do this with an “absolute reference,” which means that the formula does not change when you copy it to another cell.
In the example above, edit the formula in cell B1 by inserting dollar signs in front of the “A” and the “1” in the cell reference.
Now copy the formula in cell B1 down to B2 and examine the result. Instead of changing to “=A2+1”, it shows “=$A$1+1”, just as you typed it in B1. Wherever you copy a formula with an absolute reference, it will always to point to the original source.
Mixed References
Sometimes you need a formula always to refer to the original source column, but to change with each row. You can do this with a mixed reference—that is, one that is made up partially of relative references and partially of absolute references.
In the example above, change the formula in B1 to “=$A1+1”. Now copy it to a cell in a different column and a different row. Wherever you paste the formula, it always refers to column A, but the row changes to the current row.
Single-Column References
Excel provides an alternative method of referring to the cell in a specific column of the current row: by referring only to the column, leaving the row out of the reference. In the example above, change the formula in B1 to “=$A:$A+1” and copy this formula anywhere in the spreadsheet.
Because of the dollar signs, this formula refers to the value in column A, regardless of where you paste it; and because the row is not specified, it always refers to the current row.
Next Steps
Excel’s relative and absolute references provide you the ability to create powerful formulas that can be copied across multiple rows and columns, always returning the answers that you need. For a next step, try using range names, which act like absolute references but, by using your own custom names, make your formulas easier to read and maintain.