Excel #SPILL!, #REF! and #N/A: Recovering a Model Without Hiding the Problem
Back to blog
product·September 5, 2026·5 min read·By Yehonatan Saadia

Excel #SPILL!, #REF! and #N/A: Recovering a Model Without Hiding the Problem

Three Excel errors, three different failures: no room, a deleted reference, a value not found. What each means and why IFERROR erases the evidence you need.

Key takeaways

  • #SPILL! is a space error. Microsoft lists causes including a spill range that is not blank, a range beyond the sheet's boundaries, an array formula inside a table, and merged cells.
  • #REF! is destructive: the reference has been deleted and cannot be recovered from the formula. An undo immediately after the deletion is usually your best chance.
  • #N/A is often a correct answer. Microsoft states it generally indicates a formula could not find what it was asked to look for.
  • Blanket-wrapping in IFERROR turns all three into an empty cell and erases the difference between them.
  • Excel offers a Select Obstructing Cells command for spill errors, which saves hunting for the blocking cell by hand.

These three errors describe three completely different failures. The first means the formula is valid but has nowhere to spill into. The second means the reference itself no longer exists, usually after a deletion. The third means the lookup ran correctly and did not find the value. Only the first is solved by clearing cells.

Three errors, three different stories

#SPILL!#REF!#N/A
What happenedThe formula has no room for its resultThe reference it points at does not existThe lookup finished with no match
State of the formulaValidBrokenValid
Has data been lostNoPossiblyNo
Typical fixClear the spill rangeRestore the reference or undo the deletionCheck the lookup value and the source
How urgentLowHighDepends on context

The third row is the practical difference. Two of them are messages; the third is evidence that something structural in the workbook has already been destroyed.

What causes a spill error and how do you clear it?

The underlying cause is always the same - the result does not fit - but Microsoft documents several variants, and each needs a different move:

  • The spill range isn't blank. One or more cells in the range already contain data. Microsoft notes the range may appear blank while still containing invisible characters or formulas that return an empty string.
  • The spill range is too big. A sheet holds 1,048,576 rows and 16,384 columns, and any spill beyond that fails. This happens when a whole-column reference is used from a cell that is not in row one.
  • An array formula inside a table. Spilled array formulas are not supported in Excel tables. The fix is to move the formula out of the table or convert the table to a range.
  • Merged cells in the way. A spill cannot enter merged cells. Un-merge them or move the formula to a range that does not intersect them.
  • Out of memory. The formula is attempting to produce an array too large to hold. Reference a smaller array or range.

The fast tool: click the error indicator and choose Select Obstructing Cells, and Excel highlights exactly which cells are preventing the spill instead of leaving you to find them.

A reference error is not a bug - it is damage

It appears when a formula refers to a cell that is no longer valid, and that happens most often when cells referenced by the formula were deleted or pasted over. The substantive difference from the other two: the information about what used to be there no longer exists in the formula. Excel does not remember where you were pointing.

The common forms, as Microsoft describes them:

  • Deleting a row or column that was named in an explicit cell-by-cell reference. A range reference survives this far better than a comma-separated list of individual cells.
  • A VLOOKUP asking for a column number larger than the number of columns in the lookup range.
  • An INDEX asking for a row or column outside the boundaries of the defined range.
  • An INDIRECT pointing at a workbook that is closed.
  • Broken OLE or DDE links to a program that is not running.

The operational rule: if you are looking at a reference error that just appeared, stop working and do not save. Undoing immediately after the deletion is the only route that returns the reference without rebuilding it by hand.

When is a not-found result actually the right answer?

When the value genuinely is not in the source. Microsoft defines #N/A as indicating that a formula could not find what it was asked to look for, and in a healthy model that is frequently the conclusion you wanted: a customer with no order, an item not in the catalogue, a month not yet closed.

The causes that do need fixing separate out quickly, per Microsoft:

  • The lookup value and the source data are different data types - a number against text stored as text is the classic case.
  • Leading or trailing spaces in the cells. TRIM solves it, but only once you have confirmed that is the cause.
  • Approximate match instead of exact, meaning TRUE rather than FALSE in the match argument.
  • An array formula referencing a range that does not have the same number of rows or columns as the range holding the formula.
  • A value entered manually via NA() and never replaced with real data.
  • A required function argument missing.

Why IFERROR is usually the wrong fix

Because it catches all three errors together and returns the same value for every one of them. A model wrapped in IFERROR shows zero for a customer that was not found, zero for a deleted reference, and zero for a formula broken by merged cells - with no way to tell them apart afterwards.

  • If you only want to handle a not-found value, IFNA is narrower and leaves reference errors visible.
  • Decide what the substitute value asserts. Zero and "not found" are two different statements in a report.
  • Do not wrap before you have diagnosed. Wrapping is a presentation decision, not a diagnostic tool.

A recovery order that preserves the evidence

  1. Stop. Do not save and do not keep editing a workbook that has just filled with reference errors.
  2. Try an immediate undo. It is the only action that restores a deleted reference without rebuilding it.
  3. If the file was already saved, restore a previous version into a new file rather than overwriting the current one.
  4. Map the damage by type and count how many of each. The counts set the priority.
  5. Fix the reference errors first, because every other repair depends on the structure being sound.
  6. Then clear the spill ranges, and only afterwards work on the lookup values.
  7. Leave any not-found result that is not really an error visible, or replace it with explicit text such as "not found".

That order is not arbitrary. Repairing lookup values before repairing references creates double work, because every formula you fix breaks again the moment you restore the structure underneath it.

Preventing the next round

  • Replace individual cell references with range references or named tables. Deleting a row inside a range does not break it the way it breaks a list of individual cells.
  • Separate the input sheet from the calculation sheet. Deletions almost always happen on the sheet people edit by hand.
  • Do not use merged cells anywhere formulas write into. It is the quietest cause of spill errors there is.
  • Confirm the file has active version history. Without it, an undo is the only chance you get.

Related: Concurrent spreadsheet edits and conflict control, When you have outgrown spreadsheets, A method for consolidating dozens of Excel sheets.

Sources

#Excel#formula errors#SPILL error#REF error#model recovery#שגיאות

Frequently asked questions

The range looks empty and I still get a spill error. Why?

Microsoft notes that a spill range may appear blank while still containing invisible characters or formulas that return an empty string. The quickest way to locate the blocker is the Select Obstructing Cells command from the error indicator, which highlights the offending cells directly.

Can I recover the original reference after it was deleted?

Not from the formula. Excel does not retain where the reference pointed before it was deleted. The only two routes are undoing immediately after the deletion, or restoring a previous version of the file and rebuilding the reference from that.

Does every not-found result need fixing?

No. It indicates a lookup found no match, which is frequently the correct outcome - an item that genuinely is not in the catalogue, for instance. Fix it when it stems from a data-type mismatch, stray spaces, an approximate match where an exact one was needed, or a missing argument.

Why does an array formula work outside a table and fail inside one?

Because spilled array formulas are not supported inside Excel tables. That is a stated limitation rather than a bug. The two options are to move the formula out of the table, or to convert the table to an ordinary range and give up the features the table provided.

Keep reading

Related service

Access & Excel Rescue

Stabilise the file the business runs on, then fix it or move it to the web.

Learn more →←

About the author

Yehonatan Saadia

Freelance automation, web & MVP developer

I'm Yehonatan Saadia, a senior developer who builds business automation, custom websites, and MVPs for small and mid-sized companies across the US, Europe, and Israel. These guides come from real client work, not theory.

Work with me

Have a project like this?

Tell me what you're trying to automate or build. I reply within 24 business hours with a few targeted questions, then we walk through it on a free 30-minute call, with no commitment. You come away with a scope, a timeline and a fixed price - or a straight answer that it isn't worth building.