Home » excel » string – iserror formulae in excel

string – iserror formulae in excel

Posted by: admin May 14, 2020 Leave a comment


In excel if I have the following


if it errors then it throws some thing like


so i tide this up by saying

=iserror((match(“abc”,A:A,0),”Not found”,match(“abc”,A:A,0) )

but this seems messy code.. running the same formula twice, can this be formated better to give the same result?


How to&Answers:

Which version of Excel are you using? In Excel 2007 or later versions you can use IFERROR function to avoid repetition

=IFERROR(MATCH("abc",A:A,0),"Not found")

or in earlier versions you could employ COUNTIF

=IF(COUNTIF(A:A,"abc"),MATCH("abc",A:A,0),"Not found")


I’m not aware of a built-in way to do this, but you could write your own VBA function:

Function GracefulError(varValue As Variant, strMessage As String) As Variant
    If IsError(varValue) Then
        GracefulError = strMessage
        GracefulError = varValue
    End If
End Function


=GracefulError(match("abc",A:A,0), "Not found")