#REF! error: what it means and how to fix it
The formula refers to a cell that does not exist: it was deleted, or the formula reaches outside the range it was given.
The usual causes
- A row or column the formula used was deleted. Excel replaces the reference with #REF! inside the formula itself.
- A VLOOKUP column number is larger than the number of columns in the table.
- A formula was copied so far that its relative references moved off the edge of the sheet.
How to fix it
- Undo the deletion if you just made it, then delete the data rather than the row.
- Count the columns in the VLOOKUP range: in A2:B4 the price is column 2, not 3.
- Look inside the formula for the text #REF! and replace it with the right cell.
Fix a broken formula live
The table A2:B4 has only two columns. Cell E2 shows #REF!. Change the formula in the bar until the error goes away, or press “Show the fix”.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | ||||||
| 3 | ||||||
| 4 | ||||||
| 5 | ||||||
| 6 | ||||||
| 7 | ||||||
| 8 |
#REF! The column number 3 is past the edge of the 2-column table.
Uses VLOOKUP. Start with the free spreadsheet lessons →
Runs in your browser; nothing you type is sent anywhere. Works like Excel, Google Sheets and LibreOffice Calc for the common functions.
Learn the skill behind it
Practice cell references in the free formula lesson →
Find a row with VLOOKUP in the Pro lesson →