Skip to content

All-Access: every lesson, no ads. $8.25€8.25US$8.25$4.08US$4.08$2.41US$2.41₹224.91MX$74.91 a month, billed yearly. Free to start. Cancel any time

See plans
All-Access, no ads: every lesson, course and template. $8.25€8.25US$8.25$4.08US$4.08$2.41US$2.41₹224.91MX$74.91 a month. + GST at checkoutSee the plans →

Functions

Absolute Reference in Excel: Lock a Cell with $A$1

By the LogicExcel Editorial Team20 min read3,814 wordsPractice this

Put a dollar sign before the column letter and the row number to lock a cell: =B2*(1+$H$1) keeps pointing at H1 when you copy it down. Press F4 with the cursor on a reference and Excel adds the dollar signs for you. Without them, the reference is relative and moves with every copy.

Ready to practice?

Apply what you just learned with interactive exercises.

Start Lesson 81

This page explains relative, absolute and mixed references, the F4 key on Windows, Mac and the web, and worked copy-down tables. It also shows why a copied formula returns wrong values and how to fix it.

TL;DR

  • A relative reference such as B2 shifts when you copy the formula. An absolute reference such as $B$2 never shifts.
  • A mixed reference locks only one part: $B2 locks the column, B$2 locks the row.
  • Select the reference in the formula bar and press F4 to cycle through the four forms. On a Mac, Microsoft lists Cmd+T or F4.
  • Lock the cell that holds a rate, a total or a lookup table. Leave the cells that should move relative.
  • If a copied formula gives wrong numbers, press F2 in the cell that went wrong and see which reference slid.
  • Dollar signs are only typed characters. They change what Excel does when the formula is copied, not the value the formula returns where it sits.

Table of Contents

The sample data used on this page

A small hardware shop prices its stock with one markup rate. The products are in A1:F6. The markup, 25%, sits in H1 with its label in G1. Below that are a discount grid in A8:D11 and a list of order lines in A13:B16 to look up. Columns D and E show values here; you build them with the formulas on this page, and F is empty until Example 3.

RowABCDEFGH
1ItemCostQtySell priceLine totalShareMarkup0.25
2Hammer80101001000
3Spirit level1504187.5750
4Paint 1L1206150900
5Sandpaper154018.75750
6Drill bit set2103262.5787.5
The discount grid:
RowABCD
8Price0.050.100.15
9100
10200
11500
The order lines to look up:
RowAB
13Order lineCost
14Drill bit set
15Hammer
16Paint 1L

Relative, absolute and mixed references

Every cell reference in a formula is one of four kinds. The kind decides what Excel writes when you copy the formula to another cell.

Written asNameColumn when copiedRow when copied
B2RelativeMovesMoves
$B$2AbsoluteLockedLocked
B$2Mixed, row lockedMovesLocked
$B2Mixed, column lockedLockedMoves
Microsoft describes it this way: by default, new formulas use relative references, and when you copy one the reference adjusts. An absolute reference such as $A$1 always refers to a cell in a specific location, and copying the formula leaves it unchanged. A mixed reference is an absolute column with a relative row, or an absolute row with a relative column.

Microsoft's own table shows a formula in A1 copied two cells down and two cells right:

Reference in A1After copying two down and two right
$A$1$A$1
A$1C$1
$A1$A3
A1C3
Read the table by asking what each part does. Without a dollar sign, a column letter moves two to the right (A to C) and a row number moves two down (1 to 3). A dollar sign in front of a part freezes that part.

Ranges work the same way, one end at a time. $B$2:$B$6 is fully locked. B2:B6 slides as a block. Whole columns and rows can be locked too: $B:$B locks column B, and $2:$2 locks row 2.

How to make a cell reference absolute with F4

You can type the dollar signs, but F4 is faster and never puts one in the wrong place.

  1. Double-click the formula cell, or select it and press F2, so you are editing it.
  2. Click inside the reference you want to change, or select it in the formula bar.
  3. Press F4.
  4. Press F4 again to move to the next form, until you reach the one you want.
The cycle for a reference typed as A1 is:

A1, then $A$1, then A$1, then $A1, then back to A1.

So one press locks everything, two presses lock the row, and three lock the column. Microsoft's instruction is the same: select the cell with the formula, select the reference in the formula bar, and press F4 to switch between reference types.

Three tips:

  • If you select a whole range such as B2:B6 in the formula bar and press F4, both ends change together, giving $B$2:$B$6.
  • F4 only works while you are editing a formula. Press F4 on a selected cell outside edit mode and, on Windows, it repeats your last action instead. Press F2 first.
  • On a laptop, the function keys may need the Fn key held down. On a Mac, Microsoft's keyboard list gives Cmd+T or F4 for the same toggle.

Example 1: a relative reference copied down

Start with the case where relative is exactly what you want. The line total is the sell price times the quantity. In E2, type:

=D2*C2

It returns 1000: a sell price of 100 times 10 hammers. Copy it down to E3 and Excel rewrites the row numbers so each row uses its own data:

=D3*C3

That returns 750 for the spirit levels. Every row does the same job on its own row, so relative is correct here. No dollar signs are needed. You can fill down with the fill handle, or select E2:E6 and press Ctrl+D.

Relative is the default for a reason. Most formulas in a table apply the same rule to each row, and relative references do that for free. The dollar sign is for the exceptions: the one cell every row must share.

Example 2: lock a rate in one cell

Now the sell price. Every item uses the same markup, stored in H1. In D2, a natural first attempt is:

=B2*(1+H1)

On row 2 it returns 100, which is right: 80 times 1.25. Copy it down and each row's references slide, so H1 becomes H2, H3 and so on. Those cells are empty, and an empty cell counts as zero:

RowFormula after copyingResultShould be
2=B2*(1+H1)100100
3=B3*(1+H2)150187.5
4=B4*(1+H3)120150
5=B5*(1+H4)1518.75
6=B6*(1+H5)210262.5
The first row looks right, which is why this mistake survives. Rows below it return the plain cost, as if the markup were zero. The fix is to lock H1 with F4 so both the column and the row stay:

=B2*(1+$H$1)

Copied down, the B reference moves and the H1 reference stays:

=B3*(1+$H$1)

That returns 187.5, matching the table. The rate now lives in one cell. Change H1 to 0.30 and every price updates.

Example 3: lock a total in a share calculation

A share of total divides each line by the grand total. The total is a range every row must share, so it needs locking. In F2, type:

=E2/SUM($E$2:$E$6)

The total of E2:E6 is 4187.5, so the hammer line returns about 0.2388, or 23.9%. Copy it down and E2 becomes E3 while the locked range stays put:

=E3/SUM($E$2:$E$6)

That returns 750 divided by 4187.5, about 0.1791. Now see what happens if you forget the dollar signs and copy =E2/SUM(E2:E6) down. The range slides one row at a time:

RowFormula after copyingResult
3=E3/SUM(E3:E7)750 divided by 3187.5, about 0.2353
6=E6/SUM(E6:E10)787.5 divided by 787.5, which is 1
The last row claims to be 100% of the total, and the shares no longer add to 100%. Whenever a formula compares a row with a whole range, lock the range.

For formatting the result as a percentage, see Excel Percentage Formulas: A Practical Step-by-Step Guide. For the SUM function, see How to Add Up a Column in Excel (SUM).

Example 4: a mixed reference grid

A mixed reference shines when one formula must fill a grid. The grid in A8:D11 has prices down column A and discount rates across row 8. Each cell should take its row's price and its column's discount. In B9, type:

=$A9*(1-B$8)

The column of the price is locked, so every cell in the grid reads column A. The row of the discount is locked, so every cell reads row 8. The other parts are free to move. B9 returns 95 (100 less 5%). Now copy it across and down the whole grid, and each cell gets the right formula:

CellFormulaResult
B9=$A9*(1-B$8)95
C9=$A9*(1-C$8)90
D9=$A9*(1-D$8)85
B10=$A10*(1-B$8)190
C10=$A10*(1-C$8)180
D10=$A10*(1-D$8)170
B11=$A11*(1-B$8)475
C11=$A11*(1-C$8)450
D11=$A11*(1-D$8)425
One formula, written once, fills nine cells. If you had locked everything instead, =$A$9*(1-$B$8) would return 95 in all nine, because every cell would point at the same price and the same discount.

When you write a mixed reference, decide each part on its own. Ask: when I copy this sideways, should this letter move? When I copy it down, should this number move? Lock whatever should not.

Example 5: lock the lookup table

A lookup formula has a table that should stay the same for every row and a lookup value that should change. Our order lines are in A14:A16, and the cost list is in A2:B6. In B14, type:

=VLOOKUP(A14,$A$2:$B$6,2,FALSE)

It returns 210 for the drill bit set. Copy it down and the lookup value slides to A15 and A16 while the table stays on A2:B6, so Hammer returns 80 and Paint 1L returns 120.

Without the dollar signs, the table slides with the formula. Typed as =VLOOKUP(A14,A2:B6,2,FALSE) and copied down:

RowFormula after copyingResult
14=VLOOKUP(A14,A2:B6,2,FALSE)210
15=VLOOKUP(A15,A3:B7,2,FALSE)#N/A
16=VLOOKUP(A16,A4:B8,2,FALSE)120
Hammer sits in row 2, and the slid table now starts at row 3, so the lookup cannot find it and returns #N/A. Row 16 still works only because Paint 1L happens to sit inside the slid range, which is the kind of luck that hides a bug until the data changes. See VLOOKUP Function Examples and Practice for the function itself.

Why a copied formula shows wrong values

A copied formula that looks fine but gives wrong numbers almost always has a reference that slid or one that stuck. Work through it like this.

  1. Find the first wrong cell. The rows above it are usually right. The first bad row shows you where the reference ran out of data.
  2. Press F2 in a wrong cell. Excel outlines each reference it uses, in color, on the sheet. See where each outline sits.
  3. Compare the references with row 1. If a reference that should point at one fixed cell has moved, it needs a dollar sign. If a reference that should move stayed put, it has too many.
  4. Fix the first formula, not the copy. Add the dollar signs in the top formula and copy it down again, so every row is rebuilt from the correct one.
To see all formulas at once, press Ctrl plus the grave accent key, the one above Tab, on Windows or Mac. It switches the sheet between showing values and showing formulas, per Microsoft's shortcut list.

One more cause is not about dollar signs: copy versus cut. Copying a formula shifts its relative references. Moving it with cut and paste keeps them as they were, because the formula is moved, not rewritten. If you cut and paste and the formula still points at its old cells, that is by design.

Locked references also follow their cell when you insert rows. If you insert a new row at the top of the sample, $H$1 becomes $H$2, and the formula still finds the markup. The dollar signs stop copying from moving a reference. They do not stop the sheet from moving it.

Absolute references versus the alternatives

An absolute reference is not the only way to pin a value. Here is when each choice fits.

OptionLooks likeUse it whenTrade-off
Absolute reference=B2*(1+$H$1)One cell is shared by every rowEasy to read, easy to forget
Mixed reference=$A9*(1-B$8)A grid with headers on top and at the leftNeeds thought about which part to lock
Named range=B2*(1+Markup)A rate used across many sheetsName must be defined once
Other sheet=B2*(1+Rates!$B$1)Settings live on their own sheetKeep the sheet name stable
Table reference=[@Cost]*(1+$H$1)The data is an Excel tableRow references are automatic, fixed cells still need a dollar sign
A named range is absolute by default. Define the name Markup for H1 and the formula reads the same cell wherever it is copied. This is a good habit for rates that appear in many formulas. For tables, see Excel Tables: Why You Should Use Ctrl+T on Every Dataset.

Absolute references also matter in conditional formatting rules, where the first cell of the range is the anchor. The fixed column in $C2 is why a rule can judge a whole row by one column. See Conditional Formatting Formulas in Excel: Rules and Examples.

Versions: Windows, Mac and Excel for the web

Dollar-sign references have worked the same way in Excel for a very long time, so the formulas on this page behave the same in every desktop version. Only the keys differ.

  • Windows: F4 cycles through the absolute and relative combinations while a reference is selected in a formula.
  • Mac: Microsoft's list gives F4 or Cmd+T to toggle the reference style between absolute, relative and mixed. If F4 triggers a system action on your Mac, use Cmd+T.
  • Excel for the web: Microsoft's web shortcut list also includes F4 for cycling through the combinations.
  • Fill shortcuts: Ctrl+D fills down on Windows. On a Mac, Microsoft lists Ctrl+D or Cmd+D for fill down and Ctrl+R or Cmd+R for fill right. Microsoft's web list does not include them.
  • R1C1 style: if your sheet shows numbers in the column headers instead of letters, the R1C1 style is on. There, R1C1 is absolute and R[1]C[1] is relative. Turn it off under the formula options to get A1 style back.

Errors that come from references

SymptomCauseFix
Rows below the first return the plain costThe rate reference slid onto empty cellsPress F4 on the rate so it reads $H$1.
#DIV/0! after copyingA divisor reference slid onto an empty cell, or a locked cell is empty, as in =B2/$H$2 where H2 is emptyCheck what the divisor cell holds.
#N/A from a lookup that worked on row 1The lookup table was not locked and slid downLock the table as $A$2:$B$6.
Shares add up to more than 100%The total range was not lockedUse SUM($E$2:$E$6).
Every cell in a grid has the same resultBoth parts were locked, as in =$A$9*(1-$B$8)Lock only the column of one input and the row of the other.
F4 does nothingYou are not editing, the cursor is not on a reference, or the function key needs FnPress F2, click inside the reference, then F4. On a Mac try Cmd+T.
#REF! appearsThe row or column a reference pointed to was deletedUndo the deletion, or rewrite the reference.
The formula reads the old cell after you moved itCut and paste does not change referencesUse copy and paste if you want the references to shift.

What learners get wrong

There is no practice lesson tied only to this page, so there are no first-attempt counts to quote. These are the slips that come up whenever people first meet the dollar sign, with the form that works.

Locking nothing. The formula works on row 1 and fails below. The fix is to lock the cell that holds the shared value, as in =B2*(1+$H$1).

Locking everything. Pressing F4 once gives $H$1, and some people press it on every reference. Then the item cost cannot move down the rows, and every row returns the same answer. Lock the shared cell only.

Locking the wrong half of a mixed reference. $A9 and A$9 are different. In the grid, the price is in a column that stays and a row that changes, so it is $A9. The discount is in a row that stays and a column that changes, so it is B$8. If you swap them, the grid fills with nonsense or errors.

Pressing F4 outside edit mode. The cell is selected, not edited, so F4 repeats the last action. Press F2 first.

Typing the dollar sign by hand and misplacing it. B$2 and $B2 look alike. Let F4 do it, and read the result.

Fixing the copy, not the first formula. If the copies are wrong, fix the top cell and copy again. Patching each copy by hand leaves a mix that nobody can audit.

Expecting a cut to shift references. Cut and paste moves the formula as it is. Only a copy shifts relative references.

For practice filling formulas right and down, see Lesson 81: Fill Right & Fill Down.

A worked job: price a delivery from a markup

A customer wants a quote for the five items, with a delivery fee as a share of the shelf value. You use the sample sheet.

  1. Set the rate once. Keep the markup in H1. Add a delivery rate of 8% in H2 with the label "Delivery" in G2.
  2. Sell price. In D2 type =B2*(1+$H$1) and copy down to D6. Each item uses its own cost and the same markup. The five prices are 100, 187.5, 150, 18.75 and 262.5.
  3. Line total. In E2 type =D2*C2 and copy down. The line totals are 1000, 750, 900, 750 and 787.5.
  4. Delivery per line. In J2 type =E2*$H$2, then copy down to J6. Locking H2 means every line uses the same 8%. The hammer line returns 80, and the last line, =E6*$H$2, returns 63.
  5. Total. The goods total =SUM(E2:E6) returns 4187.5, and the delivery total =SUM(J2:J6) returns 335.
  6. Check by changing the rate. Change H1 to 0.30. Every price and total updates because one cell feeds them all.
The two locked cells, H1 and H2, are the only dollar signs in the sheet. Everything else is relative, because every row does the same job on its own data.

Practice what you just learned

Open Lesson 81: Fill Right & Fill Down and fill a formula right and down. Then type Example 2 yourself: build =B2*(1+$H$1) on a blank sheet, copy it down and break it on purpose by removing the dollar signs, so you can see what a slid reference looks like.

A lookup is where a locked table matters most. Try Lesson 11: VLOOKUP Function and Lesson 58: VLOOKUP Practice. For more on conditions, use COUNTIF with a locked criteria cell.

FAQ

What does the dollar sign mean in an Excel formula?

A dollar sign locks the part of the reference that follows it. In $B$2 both the column and the row are locked, so the reference does not change when you copy the formula. In B$2 only the row is locked, and in $B2 only the column is.

How do I make a cell reference absolute in Excel?

Select the cell with the formula, select the reference in the formula bar and press F4. One press gives $A$1. Pressing again gives A$1, then $A1, then back to A1. You can also type the dollar signs by hand, but F4 is faster and avoids typos.

What is the shortcut for an absolute reference on a Mac?

Microsoft's keyboard shortcut list gives Cmd+T or F4 on a Mac to toggle between absolute, relative and mixed references. If F4 triggers a system function on your keyboard, use Cmd+T while you are editing the formula and the cursor is on the reference.

What is the difference between absolute and relative references?

A relative reference such as B2 changes when you copy the formula, so each copy points at a cell the same distance away. An absolute reference such as $B$2 stays on the same cell wherever you copy it. Use relative for row-by-row work and absolute for shared inputs.

Why does my Excel formula change when I copy it?

Because the references are relative. Excel keeps the distance between the formula and each cell it uses, so copying one row down moves every reference down one row. Add dollar signs to any reference that must stay on one cell, then copy again.

How do I remove dollar signs from a reference?

Select the reference in the formula bar and press F4 until the dollar signs are gone, which is the third press from $A$1. To clear many formulas at once, use Find and Replace: put a dollar sign in Find what, leave Replace with empty and search within formulas.

How do I use an absolute reference to another sheet?

Write the sheet name, an exclamation mark and the locked cell, such as Rates!$B$1. Put it in the formula where the rate belongs, for example =B2*(1+Rates!$B$1). Press F4 with the cursor on that part of the reference to add the dollar signs.

Sources

Keep going

Guides people read next.