Excel Practice Test

โ–ถ

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.

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

๐Ÿ“‹ VLOOKUP

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

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.

๐Ÿ“‹ INDEX/MATCH

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 / FIND

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.

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.

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
Take FREE Excel Formulas Questions and Answers

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

๐Ÿ“…
2007
Excel version introduced
๐Ÿ“‹
7
Error types caught
โœ…
1ร—
Formula evaluations
๐ŸŒ
All
Excel versions supported
โฑ๏ธ
<1 ms
Overhead per cell
๐Ÿ“Š
#1
Most-used error function
Take FREE Excel Functions Questions and Answers

Building an IFERROR-Ready 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.

๐Ÿ”

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.

Excel Questions and Answers

What does IFERROR do in Excel?

IFERROR returns the result of your formula normally โ€” but if the formula produces any error value (#N/A, #DIV/0!, #VALUE!, #REF!, #NUM!, #NAME?, #NULL!), it returns whatever fallback value you specified instead. The syntax is =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.

What's the difference between IFERROR and IFNA?

IFERROR catches every Excel error type. IFNA catches only #N/A. Use IFNA when you specifically want to handle lookup misses (VLOOKUP, MATCH, XLOOKUP not finding the value) while letting other errors like #VALUE! or #REF! still display โ€” those usually indicate real bugs you should fix. Use IFERROR when you want to silence everything, typically on dashboards seen by non-technical users.

Can I nest IFERROR inside other functions?

Yes. IFERROR returns a single value or array, so it works anywhere a value would go โ€” inside IF statements, SUMPRODUCT, array formulas, conditional formatting rules. A common nested pattern is tiered lookup: =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.

Does IFERROR slow down my spreadsheet?

Barely. Each IFERROR adds fractions of a millisecond of overhead. For a worksheet with a few thousand IFERROR-wrapped formulas, you won't notice anything. The bigger performance trap is the old =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.

How do I use IFERROR with VLOOKUP?

Wrap the entire VLOOKUP: =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.

Can IFERROR catch logical errors or just Excel errors?

Just the seven Excel error values (#N/A, #VALUE!, #DIV/0!, #REF!, #NUM!, #NAME?, #NULL!). It can't tell you a formula is producing the wrong answer โ€” only that it produced an error. If your VLOOKUP returns the value 0 because the matched row genuinely contains 0, and you wrapped it in =IFERROR(VLOOKUP(...), 0) hoping to catch misses, you can't distinguish those two cases. For that, you'd need ISNA-based logic.

What's the best fallback value to use?

Match the column's data type. Numeric columns: use 0 or the empty string "". Text columns: use a descriptive label like "Not found" or "Pending". Date columns: use a sentinel date or blank. The wrong fallback type breaks downstream formulas โ€” putting "N/A" in a numeric column will cause SUM and AVERAGE to throw #VALUE! errors. Test the column with a fallback in place before publishing.

Can I use IFERROR in conditional formatting rules?

Yes. Conditional formatting accepts any formula that returns TRUE or FALSE, so wrapping with IFERROR works fine โ€” for example, =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.
โ–ถ Start Quiz