• if iserror

    Author
    Topic
    #461941

    With a normal vlookup I can use if iserror to avoid #N/A:
    =IF(ISERROR(VLOOKUP(F2,nvl,2,FALSE)),”Not found”,VLOOKUP(F2,nvl,2))

    However, when I try to do a left lookup with index and match:
    =INDEX(lreturn,MATCH(F3,lcc,0)) and then add if iserror I get a #Value error.
    =IF(ISERROR(INDEX(lreturn,MATCH(F3,lcc,0))),”Not Found”),INDEX(lreturn,MATCH(F3,lcc,0))

    What am I doing wrong? I use Excel 2003.
    Thanks

    itconc

    Viewing 0 reply threads
    Author
    Replies
    • #1173904

      The parentheses aren’t quite correct. Try

      =IF(ISERROR(INDEX(lreturn,MATCH(F3,lcc,0))),”Not Found”,INDEX(lreturn,MATCH(F3,lcc,0)))

      In fact, you only need to test whether MATCH returns an error:

      =IF(ISERROR(MATCH(F3,lcc,0)),”Not Found”,INDEX(lreturn,MATCH(F3,lcc,0)))

      • #1174043

        The parentheses aren’t quite correct. Try

        =IF(ISERROR(INDEX(lreturn,MATCH(F3,lcc,0))),”Not Found”,INDEX(lreturn,MATCH(F3,lcc,0)))

        In fact, you only need to test whether MATCH returns an error:

        =IF(ISERROR(MATCH(F3,lcc,0)),”Not Found”,INDEX(lreturn,MATCH(F3,lcc,0)))

        That did it. Thanks, Hans

    Viewing 0 reply threads
    Reply To: if iserror

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: