• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Handling #N/A error with VLOOKUP( ) inside of an IF( )

=IF(VLOOKUP(C5,$K:$K,1,0)="#N/A","Error","OK")

With this formula, the VLOOKUP returns an #N/A error which equals "#N/A" therefore the condition should evaluate as TRUE and return the word "Error," but instead it returns #N/A.

What is wrong here?
 
Perhaps
=IF(ISNA(VLOOKUP(C5,$K:$K,1,0)),"Error","OK")
In this case however
=IF(MATCH(C5,$K:$K,0),"OK","Error")
does the same as you are searching a one-column range
(IMO using entire columns is bad practice)
 
Perhaps
=IF(ISNA(VLOOKUP(C5,$K:$K,1,0)),"Error","OK")
In this case however
=IF(MATCH(C5,$K:$K,0),"OK","Error")
does the same as you are searching a one-column range
(IMO using entire columns is bad practice)
This formula:=IF(MATCH(C5,$K:$K,0),"OK","Error")

It will return #N/A, if the formula does not found the Lookup value

so

It should be:

=IF(ISNA(MATCH(C5,$K:$K,0)),"OK","Error")

Regards
 
Back
Top