WorksheetFunction.IfError Method (Excel)
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(Arg1, Arg2)
식 A variable that represents a WorksheetFunction object.
Parameters
Name |
Required/Optional |
Data Type |
Description |
---|---|---|---|
Arg1 |
필수 |
Variant |
Value - the argument that is checked for an error. |
Arg2 |
필수 |
Variant |
Value_if_error - 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!. |
Return Value
Variant
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.