Robblob
Robblob

Reputation: 77

IFERROR STATEMENT WITHIN VLOOKUP

I asked for help on another formula earlier which has lead to another head scratcher for me. I'm sure there is probably a way to use IFERROR somewhere in the formula below, but I can't seem to figure out where. I have a few columns returning #N/A that I just need to be blank.

Everything is working how it should except for the error. I have another formula feeding off of the results of this formula that I need to populate either Y or N based on the results. The #N/A is throwing some of them off.

=IF(J2="",VLOOKUP(B2,Sheet1!B:F,5,FALSE),"PICKED UP")

Upvotes: 2

Views: 2397

Answers (2)

T I
T I

Reputation: 9943

=IF(J2="", IF(ISNA(VLOOKUP(B2,Sheet1!B:F,5,FALSE)), "", VLOOKUP(B2,Sheet1!B:F,5,FALSE)),"PICKED UP")

Upvotes: 0

Jerry
Jerry

Reputation: 71598

Just wrap it like this:

=IF(J2="",IFERROR(VLOOKUP(B2,Sheet1!B:F,5,0),"Error msg here"),"PICKED UP")

IFERROR will evaluate the first expression (here, it's the VLOOKUP) and if it returns an error, it will return the second part of the formula, which is Error msg here in this case. Change it to whatever you want to.

Also, you can use 0 to mean FALSE in excel (and 1 to mean TRUE).

Upvotes: 2

Related Questions