Key Takeaways:
- Every Excel error code tells you a specific root cause:
#N/Ameans missing lookup match,#VALUE!means wrong data type,#REF!means deleted cell reference,#NAME?means misspelled function/range name,#DIV/0!means dividing by zero, and#SPILL!means a blocked dynamic array.- Never blindly wrap broken formulas in
IFERROR(..., 0)before verifying the root cause—masking a#REF!or#VALUE!hides real reporting errors.- Need instant debugging? Browse our Excel Formula Errors directory, paste a broken formula into the AI Formula Fixer, or audit your full workbook in ExcelGPT ChatExcel Studio.
Nothing stalls a financial close or KPI review faster than a column suddenly erupting with #N/A, #VALUE!, or #REF! errors. Worse, because downstream SUM and AVERAGE cells inherit any error inside their input range, a single broken row can wipe out an entire executive summary.
This diagnostic guide covers the seven Excel formula errors you encounter most often, how to isolate the root cause in under 60 seconds, and the cleanest permanent fix for each one.
Quick-Reference Cheat Sheet: All 7 Excel Formula Errors
| Error Code | Plain-English Meaning | Most Common Cause | Fastest First Check |
|---|---|---|---|
#N/A | Value not available | Lookup key missing, extra spaces, or number vs. text mismatch | Test with =TRIM() and verify data types match |
#VALUE! | Wrong data type | Performing math on text, spaces, or mismatched array lengths | Check cells for hidden spaces or text-formatted numbers |
#REF! | Invalid cell reference | Deleted row/column/sheet referenced by a formula | Undo immediately or rebuild broken sheet/column link |
#NAME? | Unrecognized text | Misspelled function name, unquoted text, or unsupported function | Verify spelling and wrap literal text in double quotes |
#DIV/0! | Division by zero | Denominator cell is 0 or blank | Guard denominator with IF(B2=0, 0, A2/B2) |
#SPILL! | Spill range blocked | Dynamic array formula blocked by data, merged cells, or an Excel Table | Clear cells below/right or move formula outside Table |
#NUM! | Invalid numeric value | Impossible math (e.g., negative square root) or non-converging IRR | Inspect inputs for negatives, extreme powers, or dates |
1. Fixing #N/A Errors in Lookup Formulas
#N/A appears primarily in VLOOKUP, XLOOKUP, and INDEX MATCH when Excel genuinely cannot find the lookup key. Nine times out of ten, the item looks identical to human eyes but fails exact comparison because of trailing spaces or text-vs-number formatting.
Diagnosis test: In a spare cell, test =A2=Products!A15. If Excel returns FALSE even though both cells display 10425, one is text and the other is a number (or one carries trailing spaces).
=XLOOKUP(TRIM(A2)&"", TRIM(Products!$A$2:$A$500)&"", Products!$C$2:$C$500, "Missing SKU")
For VLOOKUP-specific fixes, follow our dedicated Fix VLOOKUP Not Working guide and #N/A error reference.
2. Fixing #VALUE! Errors (Type Mismatches & Hidden Spaces)
Excel throws #VALUE! when a mathematical operator receives text—for example, =A2+B2 where B2 contains "N/A", a currency symbol pasted as text, or a formula returning an empty string "".
- Switch operators to functions:
=SUM(A2, B2)gracefully ignores text values whereas=A2+B2crashes with#VALUE!. - Clean imported numbers: Strip invisible non-breaking spaces (
CHAR(160)) and convert numeric text cleanly:
=VALUE(TRIM(SUBSTITUTE(B2, CHAR(160), "")))
- Check range sizes in
SUMIFS/XLOOKUP: Every criteria range must have the exact same number of rows and columns as the sum or lookup range.

3. Fixing #REF! Errors (Broken Cell References)
A #REF! error means a cell, row, column, or worksheet the formula depended on was deleted. You will literally see #REF! written inside the formula bar, such as =SUM(B2:#REF!) or =VLOOKUP(A2, A2:C10, 5, FALSE) (asking for column 5 inside a 3-column table).
- If you deleted a column seconds ago, press
Ctrl+Z(Cmd+Zon Mac) immediately. - Prevent future
#REF!breaks by using Excel Tables (Ctrl+T) with structured column names (tblSales[Revenue]) and switching fromVLOOKUPtoXLOOKUP.
4. Fixing #NAME? Errors (Typos, Quotes & Version Gaps)
Excel shows #NAME? whenever it encounters text it does not recognize as a valid function or Named Range:
- Misspelled function:
=VLOKUP(...)or=SUMFI(...). - Unquoted text literals: Writing
=IF(A2=Paid, 1, 0)instead of=IF(A2="Paid", 1, 0). - Missing colon in a range: Writing
=SUM(A2 A20)instead of=SUM(A2:A20). - Newer function on older Excel: Using
XLOOKUP,TEXTSPLIT, orFILTERinside Excel 2016/2019 triggers_xlfn.prefixes and#NAME?.
5. Fixing #DIV/0! Safely (Without Hiding Real Bugs)
Dividing revenue growth or conversion rate by a zero or blank denominator produces #DIV/0!. Instead of masking every possible error with a blanket IFERROR, guard specifically against zero denominators so genuine #REF! or #VALUE! bugs still surface:
=IF(B2=0, 0, (A2-B2)/B2)
When calculating margin percentages where zero revenue should display a dash rather than 0%, return "-" (or NA() if feeding a chart so Excel does not plot a misleading drop to zero).
6. Fixing #SPILL! Errors in Modern Dynamic Arrays
Dynamic array functions (XLOOKUP, FILTER, UNIQUE, SORT) automatically expand into neighboring cells. If anything sits in the dashed blue spill zone—even a single space character or a merged cell—Excel stops and reports #SPILL!.
- Click the error cell to highlight the dashed outline of the intended spill area, then clear every cell inside that outline.
- If the formula sits inside a formatted Excel Table (
Ctrl+T), move the dynamic array outside the table—Tables do not support multi-cell spilling. - Avoid referencing an entire column (
A:A) inside a row-level lookup when only one cell is needed; restrict toA2or use the implicit intersection operator@.
Built-In Excel Auditing Tools Every Analyst Should Use
Before rewriting a complex nested formula from scratch, open the Formulas tab in Excel:
- Evaluate Formula: Steps through each nested sub-expression one click at a time so you see the exact inner function that flips into an error.
- Trace Precedents & Trace Dependents: Draws visual blue arrows showing which upstream cells feed your formula and which summary KPIs break downstream.
- Error Checking: Jumps directly from one broken cell to the next across large multi-sheet workbooks.
Debug Workbooks Faster with ExcelGPT ChatExcel & Formula Fixer
Auditing broken formulas across dozens of tabs is tedious when you inherit someone else's spreadsheet. Paste any broken expression into the ExcelGPT AI Formula Fixer to see what broke and get a drop-in repair—or upload your entire workbook to ExcelGPT ChatExcel Studio so AI inspects real column types, cleans text-formatted numbers via AI Data Cleaning, and verifies corrected outputs across every row.
Official reference: For Microsoft's complete technical catalog of worksheet error values, see Microsoft Support: Detect errors in formulas, or explore our interactive Excel Errors Reference Hub.
Frequently Asked Questions
Should I wrap every Excel formula in IFERROR?
No. Reserve IFERROR (or more targeted IFNA) for expected missing lookups or intentionally blank rows. Wrapping every formula blindly in IFERROR(..., 0) can hide genuine #REF! or #NAME? bugs and silently distort financial totals.
What is the difference between IFERROR and IFNA?
IFNA catches only #N/A lookup misses while letting unexpected #VALUE!, #REF!, or #NAME? errors remain visible. For VLOOKUP and INDEX/MATCH, IFNA is far safer than IFERROR—and XLOOKUP handles missing matches directly via its fourth argument.
Why does my Excel formula display as text instead of calculating?
Either the cell was formatted as Text before you typed the formula, there is a leading apostrophe (') or space before =, or Show Formulas (Ctrl+`) is toggled on. Switch the cell format to General, press F2, then press Enter.
How can I sum a column that contains #N/A or #DIV/0! errors?
Fix the upstream errors first whenever possible. If you temporarily need an error-tolerant total, use =AGGREGATE(9, 6, B2:B100) (where 9 = SUM and 6 = ignore error values) or =SUMIF(B2:B100, "<>#N/A").
Why did #VALUE! appear when I added two cells that look like numbers?
One of the cells is stored as text—often because of a leading/trailing non-breaking space from a web or PDF paste, or a European vs. US decimal separator mismatch. Use =ISNUMBER(A2) to identify which cell is text, then clean it with TRIM, SUBSTITUTE, or NUMBERVALUE.
Put this guide into practice
Run this workflow on your own spreadsheet in seconds
Upload an Excel or CSV file to generate formulas, clean messy columns, build charts, and audit results with verifiable cell changes.



