IFERROR Function
IFERROR catches errors and returns a custom value instead.
Syntax
Parameters
| Parameter | Description | Required |
|---|---|---|
| value | The formula to check for errors. | Required |
| value_if_error | The value to return if the formula results in an error. | Required |
Basic Example
Handle division by zero
=IFERROR(A1/B1, "Cannot divide by zero")Returns "Cannot divide by zero" when B1 is 0.
Advanced Examples
Example 1: Handle VLOOKUP errors
Lookup with fallbackShow friendly message when VLOOKUP fails
=IFERROR(VLOOKUP(A1, B:C, 2, FALSE), "Not found")How IFERROR Works
IFERROR evaluates the first argument. If it results in any error (#N/A, #VALUE!, #REF!, etc.), it returns the second argument.
Important Notes & Limitations
IFERROR catches ALL errors.
For catching only #N/A errors, use IFNA instead.
Common Errors & Fixes
#VALUE!Missing argumentsFix: Ensure both arguments are provided.
Download Practice File
IFERROR
iferrorPractice 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.
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.