[excel] Remove #N/A in vlookup result

How do I modify this function so that the result will merely be a blank cell rather than having #N/A show up if B2 has nothing in that cell?

I think I might need something like an ISERROR check but I don't 100% know what I'm doing.

=VLOOKUP(B2,Index!A1:B12,2,FALSE)

Thanks!

This question is related to excel vlookup

The answer is


To avoid errors in any excel function, use the Error Handling functions that start with IS* in Excel. Embed your function with these error handing functions and avoid the undesirable text in your results. More info in OfficeTricks Page


if you are looking to change the colour of the cell in case of vlookup error then go for conditional formatting . To do this go the "CONDITIONAL FORMATTING" > "NEW RULE". In this choose the "Select the rule type" = "Format only cells that contains" . After this the window below changes , in which choose "Error" in the first drop-down .After this proceed accordingly.