Fix the #REF! Error
Formulas that worked yesterday now show #REF! — typically right after someone deleted a row, column, or sheet the formulas depended on.
Excel & Google Sheets
This formula works in both Excel and Google Sheets.
How it works
#REF! means the cells a formula referenced were deleted, so the reference itself is destroyed — you'll see it embedded in the formula, like =VLOOKUP(A2,#REF!,3,FALSE). There's nothing left to point at, so the fix is to restore or re-point. If the deletion just happened, undo (Ctrl+Z / Cmd+Z) brings everything back. Otherwise, edit the formula and rebuild the broken reference to where the data lives now. To prevent the next occurrence, prefer structures that survive deletion: INDEX + MATCH references the lookup and return columns directly, so deleting an unrelated column between them breaks nothing — unlike VLOOKUP's positional column number.
When to use it
Follow this recovery path whenever #REF! appears after restructuring a sheet — and switch high-value lookups to INDEX + MATCH or XLOOKUP so the next cleanup doesn't break them.
Common mistakes
Got a file full of these?
Open it in your browser — every error cell gets highlighted with its fix. Nothing is uploaded.
Did this formula help?
Engine-verified against the sample data aboveLast reviewed 2026-07-08