Quick Answer

IFERROR Function

IFERROR catches errors and returns a custom value instead.

✓ Excel✓ Google SheetsExcel Excel 2007 and later

Syntax

IFERROR
(value, value_if_error)

Parameters

ParameterDescriptionRequired
valueThe formula to check for errors.Required
value_if_errorThe value to return if the formula results in an error.Required

Basic Example

Handle division by zero

=IFERROR(A1/B1, "Cannot divide by zero")
ResultCannot divide by zero

Returns "Cannot divide by zero" when B1 is 0.

Advanced Examples

Example 1: Handle VLOOKUP errors

Lookup with fallback

Show friendly message when VLOOKUP fails

=IFERROR(VLOOKUP(A1, B:C, 2, FALSE), "Not found")
Result: Not found
Returns "Not found" when VLOOKUP returns #N/A.

How IFERROR Works

IFERROR evaluates the first argument. If it results in any error (#N/A, #VALUE!, #REF!, etc.), it returns the second argument.

1
Enter formula
Type your formula normally.
2
Wrap with IFERROR
Wrap it with IFERROR and provide a fallback value.
3
Press Enter
The result shows the formula output or fallback.

Important Notes & Limitations

  • IFERROR catches ALL errors.

  • For catching only #N/A errors, use IFNA instead.

Common Errors & Fixes

#VALUE!Missing arguments

Fix: Ensure both arguments are provided.

Download Practice File

Practice IFERROR with Real Data

Download a sample CSV file with pre-populated data and practice exercises for the IFERROR function. Works in both Excel and Google Sheets.

Works in Google SheetsCompatible with ExcelIncludes exercises

File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps

Related Tutorials

Convert Text to Number in Excel and Google Sheets

Convert text to number in Excel and Google Sheets with VALUE, multiplication and Paste Special. Handles currency symbols, hidden spaces and #VALUE! errors.

Excel N/A Error Fix

The complete Excel N/A error fix guide: why #N/A appears in VLOOKUP and XLOOKUP, how to repair the root cause, and when to wrap it with IFNA or IFERROR.

Excel Name Error Fix: Why #NAME? Appears and How to Fix It

A practical Excel name error fix: every real cause of #NAME?, from typos and unquoted text to XLOOKUP on an older build, plus the exact fix for each one.

Excel REF! Error Fix

The complete Excel REF error fix: why #REF! appears, which edits break cell references, and how to repair the damage or prevent it from ever returning.

Excel VALUE! Error Fix

The #VALUE! error means Excel expected a number but found text. Learn how to fix an excel value error fix fast using IFERROR, VALUE, and clean data checks.

Google Sheets REGEXEXTRACT: Extract Text by Pattern

Learn Google Sheets REGEXEXTRACT with RE2 patterns: capture groups, case-insensitive flags, error handling and how to extract all matches from a string.

How to Use Excel Formulas: From the First Equals Sign to a Real Report

Learn how to use Excel formulas step by step: the equals sign, cell references, SUM, IF and VLOOKUP, plus the errors beginners hit and how to fix them.

If Statement with Vlookup

Learn how to write an IF statement with VLOOKUP to test lookup results, catch #N/A errors with IFERROR or IFNA, and replace the whole pattern with XLOOKUP.

IFERROR vs IFNA

IFERROR vs IFNA: which error handler should wrap your formulas? Compare what each one catches, with lookup and division examples for Excel and Google Sheets.

VLOOKUP Not Returning Correct Value: Five Causes and Their Fixes

VLOOKUP not returning correct value? An omitted fourth argument, an unlocked table range, a wrong column index or duplicate keys explains almost every case.

Frequently Asked Questions

What errors does IFERROR catch?
IFERROR catches #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, #NULL!.
What is the difference between IFERROR and IFNA?
IFERROR catches all errors; IFNA only catches #N/A errors.