toolrota

Excel error codes and how to fix them: #N/A, #VALUE!, #REF!, #DIV/0! and more

Seeing a code starting with # instead of a result is annoying, but every error code tells you what went wrong. Here are the most common Excel errors and their reliable fixes.

Serkan Akyürek··3 min read
Excel error codes and how to fix them: #N/A, #VALUE!, #REF!, #DIV/0! and more – Excel

When Excel cannot calculate a formula, it shows an error code starting with # instead of the result. These codes are not random; each points to a different problem. Once you recognise the code, the fix usually takes seconds.

Error codes at a glance

ErrorMeaning
#N/AThe lookup value was not found
#VALUE!Wrong data type (for example maths with text)
#REF!Invalid cell reference
#DIV/0!Division by zero
#NAME?Unrecognised function or name
#NUM!Invalid numeric value
#SPILL!A dynamic array result does not fit
#NULL!Ranges that do not intersect

#N/A: value not found

Appears when XLOOKUP, VLOOKUP or MATCH cannot find the value.

  • Check that the value really exists in the list.
  • Extra spaces or number/text differences may be the cause; clean spaces with TRIM.
  • To show a friendly message: =IFNA(VLOOKUP(F2, A:C, 3, FALSE), "Not found")

#VALUE!: wrong data type

Appears when text sits where a number is expected, for example =A2+B2 with "none" in B2.

  • Check for invisible characters and numbers stored as text (a green triangle appears in the top-left corner of the cell).
  • Convert numbers stored as text quickly with Data > Text to Columns > Finish.
  • Use SUM instead of + to add cells; SUM ignores text.

#REF!: invalid reference

Appears when a cell or column the formula refers to has been deleted.

  • Undo the deletion with Ctrl+Z.
  • When rewriting, refer to whole columns or use a table (Ctrl+T); tables update references automatically when columns are added or removed.

#DIV/0!: division by zero

Appears when the divisor is zero or empty. The cleanest fix:

=IF(B2=0, "", A2/B2)

or, to catch all errors, =IFERROR(A2/B2, 0). Use IFERROR with care: it can hide real problems too.

#NAME?: unrecognised name

  • The function name may be misspelt (=SUMM).
  • Text may be missing quotes: ="Yes" is correct.
  • Newer functions such as XLOOKUP, FILTER or UNIQUE return #NAME? in older Excel versions.
  • Formulas copied from a guide in another language need their function names translated.

#NUM!: invalid number

Appears with mathematically invalid operations, such as the square root of a negative number, or results too large for Excel. Check the input values.

#SPILL!: dynamic array does not fit

Formulas that return several results, such as FILTER, UNIQUE or SORT, "spill" into the cells below and beside them. If any of those cells contains data, you get #SPILL!.

  • Select the formula cell and clear the area shown by the dashed border.
  • Make sure there are no merged cells in the spill range.

Finding errors quickly

  • Formulas > Error Checking walks you through errors on the sheet one by one.
  • Formulas > Evaluate Formula shows step by step how a formula is calculated, the easiest way to find the source of an error in long formulas.
  • Home > Find & Select > Go To Special > Formulas > Errors selects all error cells at once.

Summary

Error codes are clues, not problems. #N/A points to the lookup, #VALUE! to data types, #REF! to deleted cells, #DIV/0! to division, #NAME? to spelling and #SPILL! to blocked space. Understanding the cause before hiding errors with IFERROR keeps your workbook trustworthy.

Share
Published:
Author
Serkan Akyürek

Serkan Akyürek is the founder and author of toolrota; he writes step-by-step guides on Excel, AI, the cloud, personal finance and digital security.