IFERROR in Excel is the function that keeps a finished report clean when formulas fail. Formulas fail. Lookups miss. Divisions hit zero. Files imported from other systems contain blanks and text where numbers should be. In a finished report, these errors look ugly, confuse readers, and sometimes break downstream formulas.
That is why IFERROR exists. It lets you catch errors and replace them with a cleaner value — a blank, a dash, a label, or a custom number. In this article, I will explain how IFERROR works, show real examples, and share the small details that turn it from a nicety into a necessary tool. By the end, you will know exactly when to reach for IFERROR in Excel.

What Does IFERROR in Excel Do?
IFERROR wraps a formula and checks whether it returns an error. If it does, IFERROR returns a value you specify instead. If it does not, IFERROR returns the formula’s normal result.
The syntax is:
=IFERROR(value, value_if_error)
Value is the formula you want to run. Value_if_error is what you want returned if the formula produces any error.
Example:
=IFERROR(10/0, "Not possible")
The formula 10/0 produces #DIV/0!. IFERROR catches that and returns “Not possible” instead.
IFERROR catches every Excel error type: #DIV/0!, #N/A, #NAME?, #NULL!, #NUM!, #REF!, and #VALUE!. This makes it a one-size-fits-all solution for error handling. That is both its strength and its weakness.
Example 1: Clean Division Results
The most common error in any spreadsheet is #DIV/0! from dividing by zero. If you are calculating growth rates, margins, or averages, empty or zero cells will break the formula.
Instead of:
=A2/B2
Write:
=IFERROR(A2/B2, 0)
The division works when B2 has a value, and shows 0 when B2 is empty or zero. The result column looks clean, and nothing downstream breaks.
If a zero does not make sense in context, use a blank instead:
=IFERROR(A2/B2, "")
Or a dash:
=IFERROR(A2/B2, "—")
The choice depends on what looks good in your report. That flexibility is one reason IFERROR in Excel is so widely used in everyday reports.
Example 2: VLOOKUP with Missing Values
VLOOKUP returns #N/A when a lookup value is not found. In a report, this looks messy. IFERROR fixes it.
Instead of:
=VLOOKUP(A2, Products!A:D, 4, FALSE)
Write:
=IFERROR(VLOOKUP(A2, Products!A:D, 4, FALSE), "Not found")
Now, any product missing from the lookup table shows “Not found” instead of an ugly error. Readers know immediately that the value is not in the system.
This is the most common use of IFERROR in Excel in real reports.
The same pattern works for INDEX MATCH:
=IFERROR(INDEX(D2:D100, MATCH(A2, A2:A100, 0)), "Not found")
Example 3: Handling Imported Data
Data from CSV files or system exports often has blanks and text where numbers should be. A SUM of such data may return #VALUE!.
Instead of:
=A2*B2
Write:
=IFERROR(A2*B2, 0)
If either A2 or B2 contains text, the multiplication fails, but IFERROR converts the error to 0. In a large report, this keeps things moving without a sea of red errors.
But be careful: IFERROR hides real problems too. If the data should have been numbers and is not, hiding it may be the wrong choice. Sometimes you want the error to remain visible so the problem gets fixed.
IFERROR in Excel is especially useful for imported data like this.
Example 4: Multiple Error Types in One Formula
Consider a formula that uses VLOOKUP and then divides by the result:
=VLOOKUP(A2, Products!A:D, 4, FALSE) / C2
This can fail in two ways. VLOOKUP can return #N/A (value not found), and the division can return #DIV/0! (if C2 is zero). One IFERROR catches both:
=IFERROR(VLOOKUP(A2, Products!A:D, 4, FALSE) / C2, 0)
This is a useful property of IFERROR — it catches every error type in one wrapper. Once you have seen it in action, IFERROR in Excel becomes a habit in any formula that combines lookups and calculations.
Example 5: Clean Up Lookups in Dashboards
In a dashboard, chart data pulled from Pivot Tables or lookups can contain errors. A chart with one #N/A cell will often show a gap or break the line entirely.
Instead of:
=IFERROR(VLOOKUP(A2, Data!A:D, 4, FALSE), NA())
Wait, that is the opposite. If you want the chart to break cleanly, use NA() to force a #N/A. But if you want the chart to look continuous, use a zero or a blank.
The rule of thumb:
- Use 0 or “” when you want the chart to stay clean
- Use NA() only when you specifically want the chart to skip a point
For most dashboard work, IFERROR with a blank or zero is the right choice. That is why so many dashboard builders rely on IFERROR in Excel to keep their charts readable.
Example 6: Conditional Logic with IFERROR
Sometimes you want to check a condition and return a message if the formula fails:
=IFERROR(VLOOKUP(A2, Products!A:D, 4, FALSE), "Check product ID")
In a customer service report, this tells the user exactly what went wrong instead of showing #N/A. That kind of message saves support tickets and speeds up troubleshooting.
This is how IFERROR in Excel turns a bare error into a useful message.
IFERROR vs IF(ISERROR())
Before Excel 2007, IFERROR did not exist. Users wrote:
=IF(ISERROR(A2/B2), 0, A2/B2)
This is longer and calculates the formula twice. IFERROR is shorter, faster, and cleaner. If you are on any version of Excel after 2007 — and you almost certainly are — use IFERROR. The old pattern is only useful in very old files.
IFERROR vs IFNA
IFNA was introduced with Excel 2013. It catches only #N/A errors and lets other error types pass through.
=IFNA(VLOOKUP(A2, Products!A:D, 4, FALSE), "Not found")
Why would you want that? Because sometimes you want to hide “value not found” but still catch real problems like #REF! or #VALUE!. IFNA is more precise.
The rule:
- Use IFERROR for general cleanup
- Use IFNA when you are specifically handling missing lookups and want to see other errors
In practice, IFERROR is more common, but IFNA is often better practice.
Choosing between IFERROR in Excel and IFNA comes down to how precise you want to be.
A Small Exercise to Try
Create a lookup sheet with a few deliberate gaps and clean it up with IFERROR. In A1 type Order ID and in B1 type Customer. Fill A2:A6 with ORD-101 to ORD-105, but leave B4 blank to simulate a missing record. In D1 type Lookup ID and in E1 type Result. Enter ORD-103 in D2, ORD-104 in D3, and ORD-999 in D4, an ID that does not exist. In E2 enter =VLOOKUP(D2, $A$2:$B$6, 2, FALSE) and copy it down. You will see a blank or an error on some rows.
Now wrap it: in E2 enter =IFERROR(VLOOKUP(D2, $A$2:$B$6, 2, FALSE), “Not found”) and copy down again. Every row now shows either a name or a clear label. Next, try IFNA in a copy of the column: =IFNA(VLOOKUP(D2, $A$2:$B$6, 2, FALSE), “Not found”). It behaves the same here, because the only error is #N/A. Finally, test the edge cases: leave D5 blank, type text into a numeric column, and divide a total by zero in another cell with =IFERROR(A2/B2, 0). Check which errors IFERROR catches and which ones you would rather see and fix.
When Not to Use IFERROR
IFERROR in Excel is useful but not always right. Avoid it when:
- You need to know about errors for data quality reasons
- You are building a chart that should break on missing data
- The formula is showing a typo or broken reference that you should fix, not hide
- You are auditing a report and need to see which rows have real problems
A good rule of thumb: use IFERROR in reports and dashboards where cleanliness matters. Avoid it in data validation and audit sheets where errors should remain visible.
Knowing when not to use IFERROR in Excel matters as much as knowing how.
Real Example: Sales Report with Missing Data
Suppose you have a sales report with revenue in column B and target in column C. You want an “Achievement %” column in D.
The formula would be:
=B2/C2
But some rows have blank targets. These produce #DIV/0!.
Better version:
=IFERROR(B2/C2, 0)
Now the column shows 0 for rows where target is missing. But 0% achievement looks misleading for rows with no target. A better approach might be:
=IFERROR(B2/C2, "No Target")
This makes it clear that the row has no target, not zero performance. IFERROR does more than hide errors — it can tell a small story about why a value is missing.
Practical Example: Cleaning Imported Data
You import order data from an ERP system. Some order IDs are missing. You want to look up customer names using VLOOKUP on the order ID.
=VLOOKUP(A2, Customers!A:C, 3, FALSE)
If A2 is blank or not found, this returns #N/A. Instead:
=IFERROR(VLOOKUP(A2, Customers!A:C, 3, FALSE), "Missing Order ID")
Now the report shows a clear label instead of an error. The operations team knows exactly what to fix.
Frequently Asked Questions
Can IFERROR handle multiple conditions?
IFERROR handles any error type but does not check conditions. For conditions, use IF, IFS, or IFNA for lookup-specific handling.
Does IFERROR slow down Excel?
A little, but not noticeably in most files. Thousands of IFERROR wrappers can add up, but if your file is slow, formulas with whole-column references are usually the bigger issue.
Can I nest IFERROR inside IFERROR?
You can, but the result is usually unreadable. If you need to handle multiple error scenarios separately, split the logic into helper cells.
Does IFERROR work with array formulas?
Yes, IFERROR works with arrays in modern Excel. Each element is checked and errors are replaced individually.
Related guide: How to Use IF, AND, OR in Excel Formulas
Related guide: INDEX MATCH Explained: Why It Beats VLOOKUP
Final Thoughts
IFERROR in Excel is a small function with a big impact. It cleans up reports, makes dashboards readable, and prevents errors from cascading through calculations. But like any tool, it works best when used with intent. Use it to make reports cleaner. Do not use it to hide problems. Understand what the error meant, decide whether to fix or hide it, and then choose IFERROR accordingly. That small pause between “error” and “hide” is what turns a good spreadsheet into a reliable one. Once you learn IFERROR in Excel, your reports will look cleaner overnight.









