IFERROR function

Excel IFERROR Function allows you to handle errors and display custom values or perform alternative actions when an error occurs in a formula. This function is useful when you want to make your spreadsheets more user-friendly and prevent error messages from confusing your audience.

Syntax

IFERROR(value, value_if_error)

Arguments

valueThe value you want to check for errors.
value_if_errorThe value or action you want to return if an error occurs in the “value” argument.

How to use

Let’s understand how to use the Excel IFERROR function with some examples:

Example 1: Basic Usage

In this example, we want to divide two numbers, but we want to handle any potential errors gracefully. If an error occurs, we want to display the message “Error.” Here’s the formula:

If A1 is 10 and B1 is 2, the formula will return 5 (10 divided by 2). However, if B1 is 0, causing a division by zero error, the formula will return “Error.”

Example 2: Using IFERROR with a Function

You can also use IFERROR with other Excel functions. For instance, let’s say you have a VLOOKUP function to find a value in a table, and you want to handle the case where the value is not found. You can do this:

If VLOOKUP finds a matching value, it will return that value. If it doesn’t find a match, the formula will return “Not Found.”

Example 3: Handling Errors in Text Functions

IFERROR can be handy with text functions like LEFT. Suppose you want to extract the first three characters from a cell (A1), but if the cell is empty, you want to return “No Data.” You can use this formula:

If A1 contains text, it will return the first three characters. If A1 is empty, it will return “No Data.”

Excel IFERROR Function is a valuable tool to make your spreadsheets more user-friendly by providing custom messages or actions when errors occur in your formulas.