Excel Formula Errors: #REF!, #VALUE! and the Rest Explained

Published:

Updated:

troubleshooting excel formula errors

Disclaimer

As an affiliate, we may earn a commission from qualifying purchases. We get commissions for purchases made through links on this website from Amazon and other third parties.

Part of our Productivity Tools guides

Troubleshooting an Excel formula error starts with finding the first cell where the result goes wrong, then checking what feeds it. A whole-column array can try to return 1,048,576 results. That scale makes troubleshooting Excel formula errors worth doing carefully.

The visible error is a clue, not a diagnosis. A formula can also return a believable result that is still wrong, putting your data, time, or file at risk. A precedent is a cell that a formula uses directly or through another formula.

Check the first affected cell before changing formulas at random. This gives you a clearer path to the cause and helps protect later results. Treat a plausible-looking result with the same care as a visible error, since either can affect a business decision.

Key Takeaways

  • Start with the first wrong result, not the final total.
  • Use an error code to narrow the type of problem.
  • Trace a formula to the cells that feed it.
  • Check formula structure and input values before adding a fallback.
  • Use error handlers only when the error is expected.

What Common Excel Error Codes Mean

The error code usually points to the kind of problem, such as a missing lookup match, invalid reference, or wrong input type. Read the code first, then check the formula and its inputs. Different errors point to different causes, so do not treat every message alike.

The table gives you a quick first check for common Excel formula errors. A code narrows the search, but the formula and data still decide the cause.

Error valueCommon causeFirst check
#DIV/0!Formula divides by zero or an empty cellCheck the divisor cell
#VALUE!Formula receives the wrong data typeCheck for text in a number input
#NAME?Excel does not recognize formula textCheck function spelling and quotes
#REF!Formula uses an invalid cell referenceInspect the referenced cells
#N/ARequired value is unavailable, often from a lookupCheck the lookup value and match range
#NUM!Function has an invalid numeric valueCheck the number and function limits

Some displayed marks are not formula errors. The ##### display often means the column is too narrow, though a negative date or time can also cause it. #NULL! points to a range separator or intersection problem, such as a space joining ranges that do not intersect.

#SPILL! can mean a dynamic array cannot place its results in the worksheet. A formula may also return an unexpected value without showing any error code. Check whether ##### disappears when you widen the column before changing the formula.

Troubleshooting Excel Formula Errors Step by Step

If a total is wrong, start with the earliest cell showing an error or unexpected result, not the final summary. Start upstream, where the formula first goes wrong. The first wrong result is usually more useful than a downstream total.

To find what is wrong with your Excel formula, check the first wrong result, its inputs, and its formula structure instead of guessing. Excel has tools for finding formula errors across one worksheet or an entire workbook.

Find error cells across a worksheet or workbook

Press Ctrl+G to open Go To, then choose Special. Select Formulas and Errors to select formula errors on the current worksheet. This can help when a large range makes each cell hard to scan.

To search a workbook, open Find and set Within to Workbook and Look in to Formulas. Search for #REF! to find broken references in formulas, even when IFERROR hides the displayed error.

Trace the earliest error to its source

Select an error cell and choose Trace Precedents to see which cells feed its formula. Red arrows point to cells that cause errors, while blue arrows point to cells without errors. A black arrow to a worksheet icon marks a source on another sheet.

Follow the arrows toward the earliest error, rather than fixing a downstream total. A total may show the effect of a problem that began several formulas earlier.

  1. Locate the first error or unexpected result.
  2. Read its code and note the affected formula.
  3. Trace its precedents to the input cells.
  4. Correct the source, then recalculate the workbook.

Use this order for error checking across a worksheet or range. Search formulas for #REF! when a displayed fallback may be hiding a broken reference.

Fix #REF! and #SPILL! Errors

A #REF! error means the formula points to a reference Excel can no longer use, while #SPILL! means Excel cannot place an array result in its intended cells. Check the cells around the formula before editing it. Restore the source reference or clear a safe space for the array.

These errors can stop a result from appearing or break work that depends on linked files. The formula itself often shows where the repair needs to happen.

#REF! points to an invalid reference

Deleted or pasted-over cells can break a referenced formula. If you deleted a row or column by mistake, press Ctrl+Z right away. Otherwise, rebuild the reference using the correct cells.

A continuous range such as =SUM(B2:D2) can adjust when you delete a column inside that range. Individually listed cells, as in =SUM(B2,C2,D2), may not adjust the same way.

Some #REF! errors come from arguments that reach beyond a range. For example, =VLOOKUP(A8,A2:D5,5,FALSE) asks for a fifth column, but the range has four. Likewise, =INDEX(B2:E5,5,5) asks for a fifth row and column in a four-by-four range.

To trace a ref error in Excel, select the error cell, inspect its formula and precedents, then restore or replace the invalid reference. INDIRECT can return #REF! when it points to a closed workbook. Excel also does not support structured references to table and column names in linked workbooks.

#SPILL! means Excel cannot place the result

Excel may outline a blocked spill range with a dashed border. Check those cells, then clear only the cells that do not hold needed information. Do not clear data blindly to make room for a formula.

A spilled array cannot fill merged cells or cells inside an Excel table. A whole-column array can also try to return 1,048,576 results and hit the worksheet grid edge.

A changing array size can cause the same issue during recalculation. For example, =SEQUENCE(RANDBETWEEN(1,1000)) can change size as it recalculates. Before deleting data to clear #SPILL!, check that the blocked cells do not contain information someone still needs.

Check Formula Syntax and Input Values

An Excel spreadsheet displays a formula with a quoted sheet name and a valid cell range, alongside colorful charts and data lines. A laptop, calculator, coffee mug, and notepads sit on a desk in a home office.
Check quoted sheet names and valid cell ranges to prevent formula errors, as illustrated by the clearly structured Excel formula.

A formula that is missing a character or uses the wrong input type can fail even when the intended calculation is simple. Small details matter when Excel reads a formula. Check its structure and each input before changing the calculation.

Formulas can combine functions, references, operators, and constants. The items below catch common structure problems before they affect more cells.

Check formula structure and references

  • Start every formula with an equal sign, =.
  • Match each opening parenthesis with a closing one.
  • Use a colon between range endpoints, as in =SUM(A1:A5).
  • Check sheet names, punctuation, and quotes in references.
  • Enter numbers without formatting, such as 3100, not 3,100.

A sheet name with spaces needs single quotation marks in a reference. For example, a formula that uses cell D3 on Quarterly Data reads =’Quarterly Data’!D3. Workbook or worksheet names with spaces or non-alphabetical characters also need quotes.

If a formula refers to a cell contains formula result, check that the reference points to the intended cell. That small check can catch a formula aimed at a label or blank cell instead of the needed number.

Match each argument to its expected type

Functions may need a number, text, or specific arguments in a set order. A formula can fail when it gets the wrong type or too many arguments. SUM, for example, can accept up to 255 arguments.

Commas or semicolons separate arguments, depending on your location settings. A #NULL! error can occur when a space joins ranges where a comma or colon was needed.

Formula basics also help when you build more complex calculations. For more examples of functions, references, and ranges, see this guide to common spreadsheet formulas. Recheck separators and decimal or thousands formatting when a formula works on one computer but not another.

Use IFERROR Without Hiding Formula Problems

Use IFERROR when several known error types need a fallback, and IFNA when only a missing lookup result should be handled. Choose the narrowest fit for the job. IFERROR handles more errors, but it can also hide a formula mistake.

IFERROR returns the formula result when no error occurs, and a fallback when one does. IFNA only catches #N/A, so it leaves other errors visible.

Choose IFERROR or IFNA

FunctionErrors handledExample fallback
IFTests a true-or-false condition=IF(A1>0,”Yes”,”No”)
IFERROR#N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, #NULL!=IFERROR(A1/B1,0)
IFNA#N/A only=IFNA(VLOOKUP(A1,D:F,2,FALSE),”Missing”)

IFERROR can catch a misspelled function name or another underlying issue, not just an expected calculation failure. Review the formula first so a fallback does not cover a problem you need to fix.

Return a blank or a useful fallback

The formula =IFERROR(A1/B1,””) returns a blank-looking result when division fails. The formula =IFERROR(1/x,0) returns 0 for a division-by-zero error. If either IFERROR argument is an empty cell, Excel treats it as an empty string.

A blank can make an unfinished report look complete. A zero can look like a real measurement, even when the calculation failed. Pick a fallback with care when people use the result to make decisions.

IFERROR can make a report easier to read when the error is expected and the fallback is clear. Do not use it to hide every error in a workbook. Check the original formula before keeping a fallback that makes an error look like a valid result.

Use IF for Multiple Conditions

An Excel spreadsheet on a laptop displays a nested IF formula that checks score conditions and returns grades, with colored cells marking #REF! and #VALUE! errors. A notepad and coffee cup sit on the wooden desk in a home office with plants and a large window.
Nested IF formulas can assign grades based on score conditions, but errors such as #REF! and #VALUE! can disrupt the results.

IF chooses a result based on a true-or-false test, so you can build several outcomes by nesting tests or using IFS. Keep each test easy to read. Put conditions in order, from the most specific to the broadest.

IF(logical_test, value_if_true, [value_if_false]) returns one value when its test is TRUE and another when it is FALSE. The last argument is optional.

For three outcomes, a nested formula could be =IF(A1>89,”High”,IF(A1>69,”Mid”,”Low”)). It checks the first test, then checks the second only when needed. IFS can make a longer set of ordered conditions easier to scan.

For letter grades, =IFS(D2>89,”A”,D2>79,”B”,D2>69,”C”,D2>59,”D”,TRUE,”F”) checks each score in order. Excel supports up to 64 nested IF functions, though a shorter formula is easier to maintain.

AND requires multiple tests to be true. OR allows an alternative condition, and you can combine OR with AND inside IF when a rule needs both. These functions help you return clear values without turning every formula into a long chain.

For three conditions in an IF function in Excel, nest two IF tests or use IFS for three outcomes. Put the most specific condition first so a broad test does not capture a case meant for a later test.

Keep Formula Errors From Disrupting Workbook Checks

Excel’s built-in checking and auditing tools can help you spot problems that a quick scan of a large workbook may miss. Use the checks as you work, not only after a report looks wrong. They can flag formula errors and other issues in cells.

Excel may mark a detected formula problem with a triangle in the cell’s upper-left corner. Checking rules can flag formula errors and other issues, and you can manage them in the settings for your computer.

  • Background error checking marks some detected problems with a cell indicator.
  • Evaluate Formula steps through parts of a calculation in Excel for Windows.
  • Watch Window tracks selected cells while you work elsewhere.

On Windows, open File > Options > Formulas to manage error-checking settings. On Mac, use Excel > Preferences > Error Checking. You can change which checks Excel applies.

Evaluate Formula shows parts of a calculation in order, which can help when one formula has several steps. Watch Window shows a cell’s workbook, sheet, name, address, value, and formula.

These tools help you keep an eye on results while working across a large workbook. Keep key output cells in the Watch Window when you need to monitor them while working on distant sheets.

Conclusion

Reliable results come from correcting the cause of a formula problem, not just removing the message on screen. Start with what feeds the result, then make sure the formula matches the data it uses.

A fallback can make a report easier to read, but it should not cover a mistake that changes the result. A believable value still deserves a check when it may guide a business decision.

Choose one workbook with an important result, trace its key inputs, and confirm that the final formula returns the value you expect.

FAQ

How to calculate error in Excel?

Excel shows an error value when it cannot evaluate a formula, but there is no universal error amount to calculate. IFERROR can return a chosen fallback when the formula fails. For example, it can return a blank or a label instead of an error message. Check the formula itself before using that fallback in a report.

How to trace a ref error in Excel?

Select the #REF! cell and inspect its formula and precedents. The formula shows which reference Excel cannot use, while its precedents help you check the cells feeding it. Restore a deleted reference if possible, or rebuild the formula with the correct cells. If you deleted the source by mistake, Ctrl+Z can undo that change.

How do I do an IFERROR formula in Excel?

Use =IFERROR(value, value_if_error) to return a fallback when the first argument produces an error. For example, =IFERROR(A1/B1,0) returns 0 if the division fails. If the division works, Excel returns its result instead. Choose a fallback that will not look like a real value when the calculation fails.

Why is my IFERROR formula not working?

Check that the formula sits inside IFERROR’s first argument and that the parentheses and separators are valid. Excel’s separator may be a comma or semicolon, based on your location settings. Also confirm that the underlying problem is an error value IFERROR catches. IFERROR will not fix a formula that returns a wrong but valid result.

What is the difference between IF and IFERROR?

IF tests a condition and returns one value when it is true, then another when it is false. IFERROR returns a fallback only when its first argument produces an error. Use IF to choose between outcomes based on a rule. Use IFERROR to handle a calculation failure that you expect and have checked.

Why would you use IFERROR?

Use IFERROR for expected errors, such as division by zero or a missing lookup result. It can keep a report readable when a fallback clearly explains the outcome. Do not use it to hide a misspelled function or another formula mistake. Check the original formula first, so the fallback does not make a failed calculation look valid.

How to use 3 conditions in IF function in Excel?

Use nested IF functions or IFS to return one of three outcomes. A nested formula checks one condition, then checks the next if needed. IFS can make a longer set of ordered tests easier to read. Use AND inside IF when multiple tests must all be true before Excel returns a result.

Why is my IFERROR returning 0?

Check whether the fallback in your formula is 0, or whether the underlying formula result is truly zero. Excel treats an empty cell used as an IFERROR argument as an empty string, not as a displayed error. The first argument may also calculate successfully and return zero. Review both arguments and test the original formula.

About the author

Latest Posts