Confident CellsExcel practice Start free

The #REF! error in Excel: what it means and how to fix it

Updated 26 November 2026 · 5 min read

#REF! means a formula points at a cell that isn't there any more. The most common cause is deleting a row or column that a formula used. Undo the delete straight away with Ctrl+Z (on a Mac, Cmd+Z), or click the cell and put the right reference back where the formula says #REF!. It means the same in every version of Excel, on Windows and Mac, and in Excel for the web.

Causes and fixes at a glance

What you seeWhyFix
=B2*#REF! in the formula barA row or column the formula used was deletedUndo the delete, or type the right cell in place of #REF!
#REF! from VLOOKUPThe column number is bigger than the tableWiden the table, or count the columns again
#REF! from INDEXThe row number is past the end of the rangeCheck the number, or the MATCH that gives it
#REF! after copying a formulaIt now points above row 1 or left of column APaste it where there's room, or lock the cell with $
=#REF!B5 where a sheet name wasThe sheet it used was deletedClose without saving if you can, or point at the right sheet

Each one is worked through below.

A deleted row or column

An order sheet works out each line's total as the quantity times the price. D2 holds =B2*C2: 4 folders at £1.20 each is 4 × £1.20 = £4.80.

ABCD
1ItemQtyPriceTotal
2Folders4£1.20£4.80
3Labels2£3.75£7.50
4Pens10£2.50£25.00
Before: D2 holds =B2*C2, copied down. 4 × £1.20 = £4.80.

Then someone deletes column C to tidy the sheet. The prices have gone, so Excel can't point at them any more, and the Total column moves left into C. Its formula becomes =B2*#REF!, and the answer is #REF!:

ABC
1ItemQtyTotal
2Folders4#REF!
3Labels2#REF!
4Pens10#REF!
After deleting column C: the totals, now in C, hold =B2*#REF!. The #REF! in the formula marks the cell that was lost.

If you've only just deleted it, undo: Ctrl+Z, or Cmd+Z on a Mac. Undo doesn't work once the file has been closed, so if it's too late, click the cell and look in the formula bar: the #REF! inside the formula shows which part lost its cell. Put the price back in a column and type that cell in place of #REF!.

Ranges cope better than single cells

A range shrinks when you delete a row inside it. A list of cells added one by one can't, so it breaks. Here row 3 (Labels, £7.50) was deleted from a list of four amounts:

ABCDE
1ItemAmountWith SUMWith +
2Folders£4.80£32.50#REF!
3Pens£25.00
4Staples£2.70
After deleting row 3: D2 held =SUM(B2:B5) and Excel changed it to =SUM(B2:B4), so it still works. E2 held =B2+B3+B4+B5 and now holds =B2+#REF!+B3+B4.

The SUM gives £32.50, the total of the three amounts left. The formula that added cells one by one has lost one of them, so it shows #REF!. Use ranges, such as =SUM(B2:B10), wherever you can.

VLOOKUP's column number is too big

=VLOOKUP(A2,$E$2:$F$5,3,FALSE) asks for the 3rd column of a range that only has 2 (E and F). Count the columns in the range, starting with the first one as 1, or make the range wider.

ABCDEFG
1CodePriceCodeNamePrice
2P-02£1.20P-01Pens£2.50
3P-03#REF!P-02Folders£1.20
4P-03Labels£3.75
5P-04Staples£0.90
B2 holds =VLOOKUP(A2,$E$2:$G$5,3,FALSE): E2:G5 has 3 columns. B3 holds =VLOOKUP(A3,$E$2:$F$5,3,FALSE): E2:F5 has only 2, so asking for column 3 gives #REF!.

This often happens when a column is deleted from the lookup table: the table gets narrower, but the column number in the formula stays the same. XLOOKUP avoids it, because you point at the column to bring back rather than counting. There's more in VLOOKUP: a simple worked example.

INDEX past the end of its range

INDEX brings back the item at a position: =INDEX($B$2:$B$5,2) is the 2nd item in B2:B5. B2:B5 holds 4 items, so asking for the 5th gives #REF!.

ABCDE
1ItemPricePositionINDEX
2Pens£2.502£1.20
3Folders£1.204£0.90
4Labels£3.755#REF!
5Staples£0.90
E2 holds =INDEX($B$2:$B$5,D2), copied down. B2:B5 has 4 items, so position 5 in D4 gives #REF!.

With INDEX and MATCH, check that the range in INDEX covers the same rows as the range in MATCH. If MATCH searches A2:A10 and INDEX only has B2:B5, a match in row 8 is past the end.

Copied off the edge

A formula in row 2 that points at the row above, =B1-B2, works. Copy it up to row 1, and it would need row 0, which doesn't exist, so it becomes #REF!. Copying a formula left can do the same at column A. Paste it where there's room, or lock the cell it must always use with $, such as $B$1, so copying doesn't move it (see absolute references).

Another sheet was deleted

A summary sheet that picks up totals from monthly sheets shows #REF! for any month whose sheet has gone. Here the March sheet is there, but the April sheet was deleted. B3 used to hold =April!B5; once the sheet is gone, Excel rewrites it as =#REF!B5, so the sheet's name is lost too:

AB
1MonthTotal
2March£1,425.00
3April#REF!
B2 holds =March!B5, the total on the March sheet. B3 pointed at the April sheet, which has been deleted, so it shows #REF!.

Excel can't undo deleting a sheet. If you haven't saved since, close the file without saving and open it again, and the sheet is back. Otherwise, type the right sheet name in place of #REF!, such as =May!B5. Formulas that point at a sheet in another workbook show #REF! in the same way if that sheet is deleted. See VLOOKUP from another sheet for formulas across sheets.

Finding them, and stopping them

Hiding #REF! with IFERROR is rarely right: it always means something is broken. For other errors, see #N/A, #NAME? and #DIV/0!.

Try it now

Your turn

Someone wrote =VLOOKUP(A2,$F$2:$G$5,3,FALSE) here and got #REF!. In C2, fix the VLOOKUP so it gives the price from the table in F2:H5. Your formula will be copied down to C5.

ABCDEFGH
1CodeQtyPriceCodeNamePrice
2P-024P-01Pens£2.50
3P-032P-02Folders£1.20
4P-0110P-03Labels£3.75
5P-043P-04Staples£0.90

Open this in Try a formula: the same sheet with the answer filled in, to change or share by link.

Part of Excel data analysis practice: every lesson on the topic, with a project in Excel.

Where it works

#REF! and every fix here are the same in every version of Excel, on Windows and Mac, and in Excel for the web. XLOOKUP needs Excel for Microsoft 365, or Excel 2021 or later.

Questions

What does #REF! mean in Excel?

It means a formula refers to a cell that no longer exists. Usually a row, column or sheet that the formula used has been deleted, so Excel replaces that part of the formula with #REF!. It also appears when VLOOKUP asks for a column past the edge of its table, when INDEX asks for a position past the end of its range, or when a formula is copied off the edge of the sheet.

How do I fix #REF! after deleting a column?

If you've only just deleted it, undo with Ctrl+Z, or Cmd+Z on a Mac, and the formulas come back as they were. Otherwise, click a cell showing the error and look in the formula bar: the #REF! inside the formula marks the reference that was lost. Type the right cell or range in its place, then copy the fixed formula down the column.

Why does VLOOKUP give #REF!?

The column number is bigger than the number of columns in the table. =VLOOKUP(A2,$E$2:$F$9,3,FALSE) asks for the 3rd column, but E to F is only 2 columns. Count the columns from the first one in the table as 1, or widen the table to take in the column you want. This often happens after a column is deleted from the table.

How do I find all #REF! errors in Excel?

Open Find with Ctrl+F, or Cmd+F on a Mac, type #REF! and choose Find All. Find searches inside formulas, so it lists every formula that has lost a cell, including ones whose answer doesn't show an error yet. To find every cell showing any error, use Go To, then Special, then Formulas with only Errors ticked.