=IFERROR(value, value_if_error)"Not Found" instead of an ugly #N/A.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.
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.
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.
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.
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.
XLOOKUP has its own built-in if_not_found argument, so you usually don't need IFERROR at all.
=XLOOKUP(A2, SKUs, Prices, "Not in catalog")That fourth argument replaces what IFERROR would have done. Use IFERROR around XLOOKUP only when you also want to catch other errors โ say, a #VALUE! from a malformed lookup value.
MATCH returns #N/A when nothing matches, which then cascades through INDEX.
=IFERROR(INDEX(Returns, MATCH(A2, OrderIDs, 0)), "No return")Wrap the entire INDEX/MATCH expression, not just the MATCH. If you wrap only MATCH, INDEX will then try to look up your fallback text as a row number and produce a different error.
SEARCH returns #VALUE! when the substring isn't found โ which IFERROR catches cleanly.
=IFERROR(SEARCH("@", A2), 0)Returns the position of the @ symbol in an email-style string, or 0 if it's not present. Useful inside larger formulas that branch based on whether a character exists.
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.
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.
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.
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.
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.
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'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.
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.
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.
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.
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.
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.
Numeric column โ 0 or blank. Text column โ meaningful label like "Not found". Avoid mismatched types that break downstream aggregations.
Use IFNA if only #N/A matters. Use IFERROR to catch everything. Wrap the entire expression โ not just an inner function.
Try blank cells, text-in-number columns, deleted references. Verify the fallback fires correctly. Check downstream SUM/AVERAGE cells still work.
Add a comment or a note column flagging which formulas suppress errors and what the fallback means. Future you will thank you.
=IFERROR(value, value_if_error). It's the single cleanest way to handle errors in worksheet formulas, available in every Excel version from 2007 forward.=IFERROR(VLOOKUP(A2, MainTable, 2, FALSE), IFERROR(VLOOKUP(A2, BackupTable, 2, FALSE), "Not found")). That tries the main table first, falls back to a backup, and finally returns text.=IF(ISERROR(formula), fallback, formula) pattern โ that runs the formula twice. IFERROR runs it once, so it's actually faster than the alternative most people compare it to.=IFERROR(VLOOKUP(A2, Customers, 4, FALSE), "New Customer"). If A2 matches something in the Customers table, you get the value from column 4. If not, you get the label "New Customer" instead of #N/A. This is the most common IFERROR use case worldwide. For lookups specifically, IFNA is often a better choice โ it ignores other errors that might signal bugs.=IFERROR(VLOOKUP(...), 0) hoping to catch misses, you can't distinguish those two cases. For that, you'd need ISNA-based logic.=IFERROR(VLOOKUP(A2, List, 2, FALSE)="Flag", FALSE) highlights cells where the lookup returns the word "Flag", and silently does nothing when the lookup misses. Without IFERROR, the error value cascades into the conditional formatting evaluator and the rule misbehaves.