Category: FUNCTION | Updated: 2026-11-20
How to Use the IFERROR Function in Google Sheets | Replace Formula Errors with Custom Values or Blanks
How to Use the IFERROR Function
The IFERROR function returns a specified fallback value or a blank cell instead of an error message when a formula evaluates to an error (#N/A, #VALUE!, #REF!, #DIV/0!, #NAME?, etc.).
Syntax
=IFERROR(value, [value_if_error])
- value: The formula or cell reference to check for an error (required).
- value_if_error: The value to return if the first argument results in an error (optional; if omitted, a blank cell is returned).
Table Example
Here is an example of a unit price calculation table that displays "Cannot calculate" instead of a division-by-zero error (#DIV/0!) when the quantity is 0.
| Row | Column A (Sales Amount) | Column B (Quantity) | Column C (Unit Price: Without IFERROR) | Column D (Unit Price: With IFERROR) |
|---|---|---|---|---|
| 1 | Sales Amount | Quantity | Unit Price (Standard) | Unit Price (Using IFERROR) |
| 2 | 50,000 | 10 | =A2/B2 → 5,000 |
=IFERROR(A2/B2, "Cannot calculate") → 5,000 |
| 3 | 30,000 | 0 | =A3/B3 → #DIV/0! |
=IFERROR(A3/B3, "Cannot calculate") → Cannot calculate |
- Formula:
=IFERROR(A3/B3, "Cannot calculate") - Result:
Cannot calculate
Common Errors and Notes
- Risk of hiding formula typos:
IFERRORhides all errors indiscriminately, including critical ones you would want to notice such as#NAME?(misspelled function name) or#REF!(deleted referenced cell). When handling missing lookup values inVLOOKUPorXLOOKUP, it is safer to useIFNAorXLOOKUP’s fourth argument (missing_value). - Using text values that affect numeric aggregations: If you specify a text string like
"-"or"Error"as the fallback value, be mindful of how functions likeAVERAGEbehave on that column later. If you want the fallback to be treated as a number, specify0.
Frequently Asked Questions
Q. How do I make IFERROR return a blank cell when an error occurs?
A. Specify an empty string "" as the second argument (value_if_error), or omit the second argument altogether (e.g., "=IFERROR(A2/B2, \"\")" or "=IFERROR(A2/B2)").
Q. What is the difference between IFERROR and IFNA?
A. IFERROR replaces all types of errors (#N/A, #DIV/0!, #VALUE!, #REF!, etc.), whereas IFNA only replaces the "#N/A" error when a lookup value is not found.