The IFERROR function in Excel catches errors (like #N/A, #VALUE!, #REF!, etc.) and returns a value you specify instead—preventing disruption to reports and calculations. You need only Excel installed (any modern version: 2007 or later) and a cell with a formula that might produce an error.

What You'll Need

  • Microsoft Excel (2007 or newer—IFERROR was introduced in Excel 2007)
  • A working knowledge of basic Excel formulas (e.g., VLOOKUP, INDEX/MATCH, arithmetic operations)
  • A dataset or formula that may generate errors (optional, but helpful for practice)

Step-by-Step

  1. Open your Excel workbook and navigate to the worksheet containing the formula that might return an error (e.g., a VLOOKUP referencing a non-existent value).
  2. Identify the original formula that could cause an error. For example, if cell B2 contains =VLOOKUP(A2,Sheet2!A:B,2,FALSE), and A2 is not found in Sheet2!A:A, Excel will return #N/A.
  3. Wrap the original formula inside IFERROR. The syntax is =IFERROR(value, value_if_error). Replace the original formula with: =IFERROR(VLOOKUP(A2,Sheet2!A:B,2,FALSE),"Not Found"). The first argument is the original formula; the second is the fallback value.
  4. Press Enter to apply. If the VLOOKUP succeeds, it returns the matched value. If it fails (e.g., #N/A), Excel displays "Not Found" instead.
  5. Copy the formula down to other cells using the fill handle (drag the small square at the bottom-right of the selected cell) to apply consistent error handling across your dataset.
  6. Test with sample data: enter a valid lookup value in A2 to confirm success, then enter a value known not to exist to verify the error is replaced as expected.

Common Mistakes

  • Confusing IFERROR with IF + ISERROR: IFERROR is simpler and more efficient than older patterns like =IF(ISERROR(formula),value_if_error,formula), which requires repeating the formula twice and can cause performance issues on large sheets.
  • Using the wrong fallback value: Passing a blank string ("") as value_if_error hides errors but may mislead users into thinking data exists. Prefer meaningful text like "N/A" or 0 only if mathematically appropriate.
  • Overusing IFERROR to mask underlying issues: If your VLOOKUP fails repeatedly, check data consistency (e.g., leading/trailing spaces, mismatched data types) rather than just hiding the result.
  • Forgetting to update the formula when the original changes: If you modify the inner formula (e.g., changing a column reference), remember to update the IFERROR wrapper accordingly.

Tips

  • Use 0 for numeric contexts: In calculations (e.g., sums), returning 0 instead of text avoids breaking downstream formulas: =IFERROR(A2/B2,0) prevents #DIV/0! from corrupting totals.
  • Combine with logical checks: For more control, use IFERROR alongside IF—e.g., =IFERROR(IF(A2>0,A2*2,"Invalid"),"Error") handles both logic and error cases.
  • Apply conditional formatting: After using IFERROR to show "Not Found", highlight those cells (Home > Conditional Formatting) to quickly identify missing data without cluttering the sheet.
  • Support team collaboration: Use clear, consistent fallback messages (e.g., "Check Source") so colleagues understand why a value isn’t calculated.

Troubleshooting

If IFERROR isn’t working as expected, follow these checks:

  1. Verify Excel version: IFERROR is unavailable in Excel 2003 or earlier. Press File > Account > About Excel to confirm your version. If outdated, update via Microsoft 365 or install the latest service pack.
  2. Check formula syntax: Ensure commas (or semicolons, depending on regional settings) separate arguments. In Europe, some locales use =IFERROR(formula;"fallback"). Test with =IFERROR(1/0,"Error") in a blank cell—if it returns "Error", syntax is correct.
  3. Confirm the error type: IFERROR catches all standard Excel errors (#N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, #NULL!), but not text that looks like an error (e.g., "#N/A" as plain text). Use ISERROR or ISERR for text comparisons if needed.
  4. Inspect nested formulas: If wrapping a complex formula (e.g., multiple nested IFs), isolate the problematic part by temporarily replacing IFERROR with a direct error-checking function like =ISERROR(cell). This helps pinpoint where the error originates.
  5. Check for circular references: If your IFERROR formula references itself (directly or indirectly), Excel may display a warning. Go to Formulas > Error Checking to resolve.

Frequently Asked Questions

Does IFERROR work with all Excel functions?

Yes. IFERROR handles errors from any formula—including VLOOKUP, INDEX/MATCH, XLOOKUP, arithmetic operations (like =A2/B2, which causes #DIV/0! if B2 is 0), text functions (e.g., =MID with invalid start positions), and custom functions—regardless of the error type.

Can IFERROR hide #N/A specifically?

Yes, but it also catches other errors. If you only want to handle #N/A (e.g., for VLOOKUP), use IFNA instead: =IFNA(VLOOKUP(...),"Not Found"). IFNA ignores #DIV/0!, #VALUE!, etc., making it more precise for lookup failures.

Why does my IFERROR formula still show an error?

IFERROR only replaces errors that occur during formula evaluation. If you type "#N/A" manually as text (e.g., in a cell), it’s not treated as an error. Also, ensure you haven’t accidentally omitted parentheses or used incorrect argument separators for your locale.

Does IFERROR affect performance?

Minimally. IFERROR evaluates the first argument once. If it’s an error, it returns the second argument immediately. This is faster than older patterns like =IF(ISERROR(...),...), which evaluate the formula twice. Still, avoid nesting IFERROR unnecessarily across thousands of rows with heavy formulas.

Can I use IFERROR to return another formula?

Yes—value_if_error can be any valid Excel expression, including a secondary formula. For example: =IFERROR(VLOOKUP(A2,Table1,2,FALSE),VLOOKUP(A2,Table2,2,FALSE)) tries Table1 first; if missing, it falls back to Table2.

Is IFERROR available in Excel Online and mobile apps?

Yes. IFERROR works in Excel for the web, Excel for iOS/Android, and Excel Desktop (Windows/macOS). However, some advanced features (like array formulas) may behave differently in older mobile versions—always test critical sheets across platforms.