XL2000: Excel Help Example Returns Incorrect Result for ERROR.TYPE Function (213891)
The information in this article applies to:
This article was previously published under Q213891 SYMPTOMS
When you use the ERROR.TYPE function in Microsoft Excel, you may not receive the value that you expect, according to the example in Excel Help. If the cell that is being compared has an error value, the example works properly; however, if this cell contains a value (a number or text), the example in Excel Help returns a #N/A error rather than the value of the cell that you are testing.
CAUSE
This behavior occurs when you evaluate a cell that does not match one of
the expected error types, as in the following example:
A1: 5
A2: 10
A3: =IF(ERROR.TYPE(A1)=7, "Value is not available", A2)
Because A1 contains a value and not an error, the ERROR.TYPE function
returns a #N/A error instead of the condition specified in the IF
argument, which is the contents of cell A2.
WORKAROUND
To work around this issue, use the ISERROR function to determine if the
ERROR.TYPE function is returning an error. If the function returns an
error, take steps to return a value instead. For example, replace the formula in the "Cause" section with the following formula:
=IF(ISERROR(ERROR.TYPE(A1)),A2,IF(ERROR.TYPE(A1)=7,"Value is not available","")) STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 9/27/2003 |
---|
Keywords: | kbbug kbpending KB213891 |
---|
|