0
0
ExcelHow-ToBeginner ยท 3 min read

How to Use IFERROR in Excel: Simple Guide with Examples

Use the IFERROR function in Excel to catch and handle errors in formulas by specifying a value to return if an error occurs. It helps keep your spreadsheet clean by replacing error messages with custom text or values.
๐Ÿ“

Syntax

The IFERROR function has two parts:

  • value: The formula or expression to check for errors.
  • value_if_error: The result to show if the first part causes an error.

It looks like this:

excel
IFERROR(value, value_if_error)
๐Ÿ’ป

Example

This example shows how IFERROR replaces an error with a friendly message. Suppose cell A1 has 10 and B1 has 0. Dividing A1 by B1 causes a division error. Using IFERROR helps:

excel
=IFERROR(A1/B1, "Cannot divide by zero")
Output
Cannot divide by zero
โš ๏ธ

Common Pitfalls

Common mistakes include:

  • Not using IFERROR when a formula might cause errors, leading to ugly error messages.
  • Using IFERROR too broadly, which can hide real problems in your data.
  • Forgetting to provide a meaningful value_if_error, which can confuse users.

Here is a wrong and right way:

excel
Wrong: =IFERROR(A1/B1)
Right: =IFERROR(A1/B1, "Error: Check inputs")
๐Ÿ“Š

Quick Reference

PartDescriptionExample
valueFormula or expression to checkA1/B1
value_if_errorResult if error occurs"No result" or 0
โœ…

Key Takeaways

Use IFERROR to replace error messages with friendly text or values.
Always provide a clear value_if_error to explain or handle errors.
Avoid hiding errors that need fixing by using IFERROR carefully.
IFERROR works with any formula that might produce an error.
It keeps your spreadsheet clean and easier to read.