Quick answer

#REF! means a formula refers to cells that no longer exist. It usually appears right after someone deletes a row, column or sheet that the formula used, and the formula then shows #REF! where the reference was. Press Ctrl+Z (Cmd+Z on a Mac) straight away to undo the deletion; later, edit the formula and point it at the right cells again. Totals built on a range, such as =SUM(B2:D2), shrink instead of breaking.

#REF! is the error that follows a cleanup. Someone deletes a column they think nobody uses, and every formula that used it breaks at once. The fix is quick once you know what Excel did to the formula.

What #REF! means

A formula names the cells it uses by their addresses, such as C2. When those cells are deleted, the address has nothing left to point at, so Excel replaces that reference inside the formula with #REF!, and the cell shows #REF! as its result. Any formula that uses that cell shows #REF! too, so one deleted column can break a whole report.

The deleted reference is gone from the formula for good. Undo brings the column back, but if you notice later, you have to type the right reference in again.

A row, column or sheet was deleted

Say a quarterly budget adds January, February and March into a total. Someone deletes the February column. A total written with + loses its middle reference, while one written with SUM adjusts:

+ names each cell, so the deleted one turns into #REF!. SUM names a range, and Excel shrinks the range when a column inside it goes. Neither total includes February now, though only the + one shows an error. Total built with +: in D2, =B2+#REF!+C2 returns #REF!. Total built with SUM: in D2, =SUM(B2:C2) returns $2,550.

Press Ctrl+Z (Cmd+Z on a Mac) right after the deletion, and the column comes back with the formulas whole. If you notice later, click the cell, select #REF! in the formula bar and replace it with the right reference, or select the cells again with the mouse. To keep it from happening, add cells with SUM and a range: a range adjusts when rows or columns inside it are deleted.

A deleted sheet is worse: formulas that used it show #REF!, and Undo can’t bring a sheet back. If you haven’t saved since, close the workbook without saving and open it again. With AutoSave on, the deletion is already saved, so restore an earlier version from the file’s version history. Otherwise, recreate the sheet and fix the formulas.

A formula was copied off the edge of the sheet

Relative references move when you copy a formula. Copy =A1*2 from row 2 up to row 1, and its reference would have to move above row 1, which doesn’t exist, so the copy shows #REF!. The same happens when a formula is copied left past column A. Copy the formula to a place where every reference still lands inside the sheet, or lock the references that should stay put with dollar signs.

Cells were pasted over

Cutting cells and pasting them onto cells that other formulas use replaces those cells, and the formulas that used them show #REF!. Undo it, then paste somewhere empty, or use Copy instead of Cut so the original cells stay where the formulas expect them.

VLOOKUP or INDEX asked for a column that isn’t there

VLOOKUP returns the column you name by number. Ask for column 4 of a table that has three, and there’s no fourth column to return:

The table $A$2:$C$6 has three columns, so there is no column 4. Ask for column 3 to get the price, or use XLOOKUP, which names the price column itself instead of counting. In C9, =VLOOKUP(A9,$A$2:$C$6,4,FALSE) returns #REF!.

This often happens after someone deletes a column from the table: VLOOKUP’s number stays 4 while the table shrinks to three columns. INDEX behaves the same way when its row or column number points outside the range. XLOOKUP vs VLOOKUP shows why XLOOKUP, with its separate result range, survives these changes.

Find every #REF! in a sheet

To list every formula with a broken reference, press Ctrl+F (Cmd+F on a Mac), type #REF!, click Options, set Look in to Formulas and click Find All.

To select every cell that shows an error, #REF! included, press F5 (or choose Home > Find & Select > Go To), click Special, choose Formulas with only Errors ticked, and click OK.

Fix the first cell in each chain; the formulas that use it clear by themselves.

Hide it, or fix it?

IFERROR can show something else in place of #REF!, but a #REF! almost always means the formula itself is broken, and hiding the error leaves a wrong total in place. Fix the reference instead.

The free lesson When Excel shows an error covers #REF! with the other common errors, and Use values from other sheets practices references to other sheets. For the error you get when a formula can’t use a value, see #VALUE! error in Excel; the full list is in types of errors in Excel.

Frequently asked questions

What does #REF! mean in Excel?

It means a formula refers to cells that no longer exist, usually because a row, column or sheet it used was deleted. Excel replaces the lost reference with #REF! inside the formula.

How do I fix a #REF! error?

If you deleted something a moment ago, press Ctrl+Z to undo it. Otherwise, click the cell, select #REF! in the formula bar and replace it with the right cell or range.

Why does VLOOKUP return #REF!?

Its column number is larger than the number of columns in the table, often because a column was deleted from the table after the formula was written. Correct the number, or switch to XLOOKUP, which doesn’t use one.

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

Press Ctrl+F, search for #REF! with Look in set to Formulas, and click Find All. Every formula with a broken reference appears in the list.

How do I stop #REF! errors when I delete rows?

Build totals with ranges, such as =SUM(B2:B10), instead of adding cells one by one. Excel shrinks a range when a row inside it is deleted, while a single deleted reference turns into #REF!.