IFERROR in Excel — Complete Guide (2026)

Master IFERROR in Excel. Catch #N/A, #DIV/0!, #VALUE! and more with the =IFERROR(value, value_if_error) formula. Real examples, IFNA vs IFERROR.

Microsoft ExcelBy Katherine LeeMay 26, 202616 min read
IFERROR in Excel — Complete Guide (2026)
Syntax: =IFERROR(value, value_if_error)
What it does: Returns value_if_error when value evaluates to any Excel error — #N/A, #VALUE!, #DIV/0!, #REF!, #NUM!, #NAME?, or #NULL!. Otherwise it returns the original result.
Most common use: Wrapping a VLOOKUP so missing matches show "Not Found" instead of an ugly #N/A.
Excel version: Works in Excel 2007 and every release since — including Excel 365 and Excel for the web.

IFERROR in Excel — Complete Guide (2026)

Your spreadsheet is full of #N/A. The dashboard you built last Friday now shows #DIV/0! in three cells because someone deleted a denominator. The boss is asking why the file looks broken. There's a one-function fix for almost all of this, and it's been baked into Excel since 2007.

IFERROR is the cleanest way to catch any error a formula produces and swap it for something readable. The syntax is simple: =IFERROR(value, value_if_error). The first argument is your real formula. The second is whatever you want to show when that formula trips. A blank string, a zero, the word "Not Found" — your call. If the formula runs fine, you get the actual result. If it errors, you get the fallback. No nesting, no excel if function with text gymnastics, no ISERROR wrapper. Just one function.

Here's the thing: most Excel users meet IFERROR through one specific pain point — VLOOKUP returning #N/A when the lookup value isn't there. Wrap it: =IFERROR(VLOOKUP(A2, Table1, 2, FALSE), "Not Found"). Done. The same pattern works for excel index match, XLOOKUP, MATCH, SEARCH, FIND, and any arithmetic that might divide by zero.

This guide walks through every common pattern, when IFERROR is the right tool versus when IFNA is better, the trap of suppressing errors you should actually investigate, and the small-but-important differences across excel versions. You'll see real formulas you can paste and adapt — not toy examples.

One warning before we start. IFERROR is powerful precisely because it eats every error, even the ones telling you your data is wrong. Used carelessly, it hides bugs that should be fixed at the source. Used well, it makes your file look polished without sacrificing accuracy.

The IFERROR formula belongs to a family of error-handling tools. ISERROR, ISERR, ISNA, IFNA, and IFERROR all exist for slightly different reasons. By the end of this guide you'll know which one fits each scenario, and you'll have a small mental checklist to run before reaching for any of them. The functions look similar on the surface. They behave very differently when you push edge cases — empty cells, hidden zeros, deleted references, mismatched data types.

Worth knowing up front. The IFERROR excel formula doesn't fix broken data. It only fixes the display of broken data. Treating it like a fix is the single most common mistake we see in audited spreadsheets. The right mindset: IFERROR is cosmetic varnish for the parts of your file that face an audience, and a guardrail for known-acceptable failure modes — not a substitute for upstream data validation.

Microsoft Excel - Microsoft Excel certification study resource

Errors IFERROR Catches

#N/A
  • Trigger: Lookup function can't find a match
  • Most common with: VLOOKUP, MATCH, XLOOKUP, INDEX/MATCH
  • Better alternative: IFNA — catches only #N/A
#DIV/0!
  • Trigger: Dividing a number by zero or an empty cell
  • Most common with: Division, AVERAGE on empty range
  • Typical fallback: 0 or blank string
#VALUE!
  • Trigger: Wrong data type passed to a function
  • Most common with: Math on text, date functions on bad inputs
  • Typical fallback: Empty string or original text
#REF!
  • Trigger: Formula references a deleted cell or sheet
  • Most common with: Copy/paste, deleted rows or columns
  • Warning: Fix the reference — don't just suppress it
#NUM!
  • Trigger: Number outside the function's valid range
  • Most common with: SQRT of negative, IRR with no solution
  • Typical fallback: Blank or N/A text
#NAME?
  • Trigger: Misspelled function name or undefined range
  • Most common with: Typos like VLOKUP, missing quotes
  • Warning: Fix the typo — IFERROR will hide your bug

How IFERROR Works Under the Hood

IFERROR evaluates the first argument. If the result is any one of Excel's seven error values, it returns the second argument instead. If the result is anything else — a number, text, a date, a boolean, even an empty string — that result passes through unchanged. That's the whole logic. No partial matching, no error code inspection.

The function was added in Excel 2007 to replace the older pattern =IF(ISERROR(formula), fallback, formula). That old version forced you to type your real formula twice — once for the check, once for the result. IFERROR runs the formula one time. Less typing. Less risk of the two copies drifting apart when you edit one.

Both arguments can be values, cell references, formulas, or nested functions. The second argument also accepts text, numbers, or another formula. Some teams use =IFERROR(VLOOKUP(...), VLOOKUP(...)) to try a second lookup against a backup table when the first misses — that pattern is fine, just slow on big datasets because both lookups get evaluated.

The IFERROR vs IFNA Decision

IFNA was added in Excel 2013 for one reason: IFERROR was being abused. People wrapped VLOOKUPs in IFERROR to catch missing matches, then complained when the formula also swallowed #VALUE! errors caused by typing a date into a number column. IFNA fixes that. It catches only #N/A — every other error still surfaces, so you notice when something else broke.

Rule of thumb. If you only care about lookup misses, use IFNA. If you want to silence every possible failure (dashboards shown to non-technical users), use IFERROR. Combining them works too: =IFNA(IFERROR(formula, "Error"), "Not Found") — though by then a clean excel if multiple conditions structure is usually more readable.

Real-World Patterns You'll Actually Use

Below are the formula patterns we see in production spreadsheets every week. Copy any of them and swap your real ranges in.

VLOOKUP with friendly message: =IFERROR(VLOOKUP(A2, ProductTable, 3, FALSE), "Product not found"). Returns the price if the SKU exists, otherwise the message. The single most common IFERROR use case worldwide.

Division that won't crash: =IFERROR(A2/B2, 0). Returns the quotient if B2 isn't zero, otherwise zero. Use blank quotes "" if you'd rather the cell look empty than show a zero.

INDEX/MATCH alternative: =IFERROR(INDEX(Prices, MATCH(A2, SKUs, 0)), ""). The same fallback logic with a more flexible lookup engine. Especially useful when the lookup column isn't the leftmost column of your table.

Conditional aggregation: =IFERROR(SUMIFS(Sales, Region, A2, Month, B2), 0). Returns a sum, or zero if the criteria match nothing. Without IFERROR, an empty intersection returns a perfectly valid zero anyway — but wrapping it shields against future column-deletion accidents.

IFERROR With Each Lookup Function

The classic combo. VLOOKUP returns #N/A when the lookup value isn't in the first column of your table.

=IFERROR(VLOOKUP(A2, Customers, 4, FALSE), "New Customer")

Returns the customer rating from column 4 if A2 matches a known customer, otherwise the label "New Customer". Switch to IFNA if you want #VALUE! and #REF! to still surface — those indicate real bugs you should fix, not missing data.

Excellence Playa Mujeres - Microsoft Excel certification study resource

Nesting IFERROR Inside Other Logic

You can put IFERROR almost anywhere a value would go. That includes inside IF statements, inside SUMPRODUCT, inside array formulas, inside conditional formatting rules. The only constraint is that the function returns a single value or array — same as any other Excel function.

A common nested pattern is a tiered lookup. Try the primary table. If that misses, fall back to a secondary table. If that misses too, return text.

=IFERROR(VLOOKUP(A2, MainList, 2, FALSE), IFERROR(VLOOKUP(A2, BackupList, 2, FALSE), "Not in either list"))

That works but reads ugly fast. In Excel 365, XLOOKUP's chaining syntax is cleaner: =XLOOKUP(A2, MainList[ID], MainList[Value], XLOOKUP(A2, BackupList[ID], BackupList[Value], "Not found")). Same result, easier to debug.

IFERROR Inside IF Statements

Sometimes you need to react differently to an error than to a regular result. IFERROR alone can't do that — it returns the fallback value as if it were a successful result. Wrap it in IF and you get conditional branching:

=IF(IFERROR(VLOOKUP(A2, Table1, 2, FALSE), "X")="X", "missing", "present")

Slightly clunky. A cleaner alternative uses ISNA or ISERROR directly:

=IF(ISNA(VLOOKUP(A2, Table1, 2, FALSE)), "missing", "present")

That avoids the magic sentinel value. Use it when the action when missing differs from the action when present — say, triggering a different SUMIFS or formatting trail.

Performance — Does IFERROR Slow Things Down?

For a few hundred cells: no measurable impact. For a workbook with 100,000+ rows of IFERROR-wrapped VLOOKUPs: yes, slightly. Each IFERROR runs its inner formula once and inspects the result. The overhead per cell is tiny — fractions of a millisecond — but it adds up when the inner formula is itself slow.

The bigger performance trap is the double-lookup pattern: =IF(ISERROR(VLOOKUP(...)), "", VLOOKUP(...)). Two VLOOKUPs every time. IFERROR runs the inner formula once and reuses the result. Always prefer IFERROR over the IF/ISERROR pattern for that reason alone.

If your file feels sluggish and you're wrapping every cell, consider switching the bulky VLOOKUPs to xlookup in excel with its native if_not_found argument — you skip the IFERROR overhead entirely.

IFERROR — Strengths and Tradeoffs

Pros
  • +Single-formula error handling — no need to type your real formula twice
  • +Works with any error type (#N/A, #VALUE!, #DIV/0!, #REF!, #NUM!, #NAME?, #NULL!)
  • +Compatible from Excel 2007 forward — Excel 365, Excel 2021, Excel for the web all support it
  • +Eliminates ugly error displays in dashboards shown to non-technical users
  • +Fast — runs the inner formula only once, unlike IF/ISERROR which runs it twice
  • +Plays nicely with conditional formatting and chart data references
Cons
  • Hides every error type — bugs you should fix get silenced along with missing data
  • Wrong fallback type (text instead of number) breaks downstream SUM or AVERAGE formulas
  • Overuse leads to a spreadsheet that looks clean but contains broken logic
  • Can mask #REF! errors caused by accidentally deleted columns
  • Not as precise as IFNA when you only care about lookup misses
  • Adds visual clutter in long formulas — XLOOKUP's native if_not_found is cleaner where available

Best Practices — When to Wrap and When to Leave Alone

Not optional. Decide which errors are signals and which are noise before you reach for IFERROR. A #N/A from a customer-not-found lookup? That's data. A #REF! from a deleted column? That's a bug. Wrapping both in IFERROR with the same fallback hides the bug indefinitely.

A working rule we've used across hundreds of client files. Wrap the lookups that face users — dashboards, reports, exported PDFs. Leave the upstream calculation cells alone. If something breaks in the source data, you want to see the error there so you can fix it, not have it propagate silently to the summary tab.

For division operations, the choice depends on context. A column calculating margin per row across hundreds of products? Wrap the divisions — empty denominators are normal for new products without sales yet. A single KPI cell on a dashboard? Leave it raw, so a #DIV/0! tells you the data feed broke.

Pick fallback values that match the surrounding data type. A column of numbers needs a numeric fallback (0 or BLANK) — text like "N/A" will break any SUM, AVERAGE, or chart axis that references the column later. Conversely, a label column should use a text fallback. Mismatching causes downstream errors that aren't caught by IFERROR and look really confusing.

Common Mistakes to Avoid

The first mistake is the worst one. Wrapping every formula in IFERROR "just in case" hides bugs that you should be fixing. We've seen workbooks where every cell was =IFERROR(formula, "") — beautiful clean look, completely impossible to debug because every error silently became blank. If a user reports the numbers are wrong, you're starting from zero clues.

The second mistake. Using the wrong fallback type. =IFERROR(A2/B2, "N/A") in a column that gets summed later breaks the SUM with a #VALUE! error — because SUM can't add the text "N/A" to numbers. Use 0 or the empty string "" for numeric contexts. Excel treats "" as text but most aggregations skip it cleanly.

Third. Wrapping the wrong scope. =IFERROR(VLOOKUP(A2, Table, 2, FALSE)*1.1, "Error") wraps the entire expression including the multiplication — fine. But =IFERROR(VLOOKUP(A2, Table, 2, FALSE), "Error")*1.1 wraps only the VLOOKUP, then multiplies the result. When VLOOKUP errors, you get "Error"*1.1 which throws #VALUE! anyway. Wrap the whole expression you want protected.

Fourth, and subtle. IFERROR catches the literal Excel error values — it doesn't catch logical wrongness. =IFERROR(VLOOKUP(A2, Table, 2, FALSE), 0) returns 0 for missing matches. But it also returns 0 if the matched value is literally zero. Downstream logic can't tell those two cases apart. If that distinction matters, use ISNA-based branching instead.

IFERROR vs ISERROR, ISERR, and ISNA

These four functions overlap in confusing ways. Quick reference: ISERROR returns TRUE for any error. ISERR returns TRUE for any error except #N/A. ISNA returns TRUE only for #N/A. IFERROR is action-oriented — it replaces an error rather than just detecting it.

Use the IS-prefixed functions inside IF when you need to branch. Use IFERROR when you just need to replace. The decision flows naturally from what you're doing — if you say "and then do X if it errors", IFERROR is shorter. If you say "and check if it errored, then maybe…", reach for ISERROR or ISNA.

VBA OnError vs Worksheet IFERROR

VBA's On Error Resume Next is a macro-level construct that lets your code continue past runtime errors. IFERROR is a worksheet function for cell formulas. They solve different problems and don't substitute for each other.

If you're writing a UDF (user-defined function) in VBA, you can wrap its internals with VBA error handling, then return whatever fallback you want — and the cell that calls your UDF gets a clean value, no IFERROR needed. If you're just typing formulas into cells, IFERROR is your only option.

Excel Spreadsheet - Microsoft Excel certification study resource

IFERROR Implementation Checklist

  • Identify which formulas face users versus which run upstream calculations
  • Decide what errors are signals (fix the source) and which are noise (suppress them)
  • Pick fallback values matching the surrounding column data type (number vs text)
  • Use IFNA instead of IFERROR when you only care about lookup misses
  • Wrap the entire expression you want protected — not just the inner function
  • Avoid the double-VLOOKUP IF/ISERROR pattern — IFERROR runs the formula once
  • Test with edge cases — empty cells, text in number columns, deleted references
  • Document any IFERROR-suppressed errors so a future editor knows they exist

Excel 365 vs Older Versions — What Changes

IFERROR itself behaves identically in every Excel version that supports it — Excel 2007 onward. What changes is what other tools are available alongside it.

Excel 2013 added IFNA. If you're stuck on Excel 2010, you only have IFERROR. The workaround for catching just #N/A in Excel 2010 is =IF(ISNA(formula), fallback, formula) — two evaluations of the formula, but functionally equivalent.

Excel 2021 and Excel 365 added XLOOKUP. XLOOKUP has a built-in if_not_found argument that supersedes IFERROR for most lookup scenarios. If your team has standardized on 365, you'll write less IFERROR than someone on 2019.

Excel 365 also added IFS, SWITCH, and dynamic arrays. None of these directly compete with IFERROR but they reduce the need for nested IF/IFERROR towers. A modern Excel 365 formula often uses XLOOKUP's native fallback instead of IFERROR, plus IFS for tiered logic, plus FILTER for what used to require array-style INDEX/MATCH.

Excel for the web and Excel mobile both support IFERROR with no caveats. Files saved in older .xls format (pre-2007) won't preserve IFERROR — it'll convert to #NAME? when opened in Excel 2003. Not relevant for most users but worth knowing if you exchange files with very legacy systems.

Combining IFERROR With Dynamic Arrays (Excel 365)

Dynamic arrays spill results across multiple cells. IFERROR works with them but you need to think about whether you're catching one error or many.

If you write =IFERROR(FILTER(Sales, Region="West"), "No data") and FILTER finds nothing, the whole formula collapses to the single text "No data". If FILTER returns 50 rows of results, IFERROR wraps the whole array and passes it through unchanged. Per-cell error catching inside a spilled array is trickier and usually requires array formulas with IFERROR applied row-by-row.

Quick Troubleshooting Reference

Your IFERROR isn't working as expected? Three things to check first. One: is the inner formula actually erroring, or just returning an unexpected value? IFERROR catches errors, not wrong answers. Two: is the fallback type matching the surrounding column? Three: are you wrapping the right scope — the whole expression or just an inner piece?

If the formula bar shows =IFERROR(...) and the cell shows #NAME?, your Excel version doesn't recognize the function — you're on a pre-2007 install or a file got converted to legacy format. Upgrade or use the IF/ISERROR pattern instead.

IFERROR by the Numbers

📅2007Excel version introducedReplaces older IF/ISERROR pattern
📋7Error types caught#N/A, #VALUE!, #DIV/0!, #REF!, #NUM!, #NAME?, #NULL!
Formula evaluationsHalf the work of IF/ISERROR
🌐AllExcel versions supported2007, 2010, 2013, 2016, 2019, 2021, 365
⏱️<1 msOverhead per cellNegligible for normal workbooks
📊#1Most-used error functionAcross all Excel productivity surveys

Building an IFERROR-Ready Formula

✏️

Write the raw formula

Start with your real calculation — VLOOKUP, division, INDEX/MATCH, whatever you actually need. Test it on a normal row first to confirm the logic works.
🔍

Identify failure modes

Think about when this formula could error. Empty lookup value? Deleted column? Division by zero? You don't have to handle every case — just the realistic ones.
🎯

Choose the right fallback

Numeric column → 0 or blank. Text column → meaningful label like "Not found". Avoid mismatched types that break downstream aggregations.
🛡️

Wrap with IFERROR or IFNA

Use IFNA if only #N/A matters. Use IFERROR to catch everything. Wrap the entire expression — not just an inner function.
🧪

Test edge cases

Try blank cells, text-in-number columns, deleted references. Verify the fallback fires correctly. Check downstream SUM/AVERAGE cells still work.
📝

Document hidden errors

Add a comment or a note column flagging which formulas suppress errors and what the fallback means. Future you will thank you.

Excel Questions and Answers

Related Excel Guides

About the Author

Katherine LeeMBA, CPA, PHR, PMP

Business Consultant & Professional Certification Advisor

Wharton School, University of Pennsylvania

Katherine Lee earned her MBA from the Wharton School at the University of Pennsylvania and holds CPA, PHR, and PMP certifications. With a background spanning corporate finance, human resources, and project management, she has coached professionals preparing for CPA, CMA, PHR/SPHR, PMP, and financial services licensing exams.