terny
terny

Reputation: 21

Excel formula nested If statments return empty row if there's no value for vlookup

=IF(B10="","",IF(VLOOKUP(B10,'Template'!A:B,2,FALSE)<$I$4,"No longer use",""))

So far I have excel formula like this, but I would like to modify code to when there's no value for vlookup return empty row instead of #NA. Is there any way to modify it like that?

Thank you!

Upvotes: 0

Views: 53

Answers (1)

Scott Craner
Scott Craner

Reputation: 152525

Wrap in an IFERROR()

=IF(B10="","",IFERROR(IF(VLOOKUP(B10,'Template'!A:B,2,FALSE)<$I$4,"No longer use",""),""))

Or we can return a ridiculously large number instead:

=IF(B10="","",IF(IFERROR(VLOOKUP(B10,'Template'!A:B,2,FALSE),1E+99)<$I$4,"No longer use",""))

Upvotes: 1

Related Questions