IFERROR function
Returns a value you specify if a formula evaluates to an error; otherwise, returns the result of the formula. Use the IFERROR function to trap and handle errors in a formula.
Syntax
IFERROR(value,value_if_error)
Value is the argument that is checked for an error.
Value_if_error is the value to return if the formula evaluates to an error. The following error types are evaluated: #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, or #NULL!.
Remarks

If value or value_if_error is an empty cell, IFERROR treats it as an empty string value ("").

If value is an array formula, IFERROR returns an array of results for each cell in the range specified in value. See the second example below.
Example: Trapping division errors by using a regular formula
The example may be easier to understand if you copy it to a blank worksheet.
How to copy an example

Create a blank workbook or worksheet.

Select the example in the Help topic.
Note Do not select the row or column headers.
Selecting an example from Help 
Press CTRL+C.

In the worksheet, select cell A1, and press CTRL+V.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.


Example: Trapping division errors by using an array formula
The example may be easier to understand if you copy it to a blank worksheet.
How to copy an example

Create a blank workbook or worksheet.

Select the example in the Help topic.
Note Do not select the row or column headers.
Selecting an example from Help 
Press CTRL+C.

In the worksheet, select cell A1, and press CTRL+V.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.


Note The formula in the example must be entered as an array formula. After copying the example to a blank worksheet, select the range C2:C4, press F2, and then press CTRL+SHIFT+ENTER.