Simplest way is to wrap your existing VLOOKUP formula in an ISERROR test, but that means for it to bring back a value, every single one of those formulas has to be run TWICE...ugh. It looks like this for example:
=IF(ISERROR(VLOOKUP(A1,B1:C10,2,FALSE)),"-",VLOOKUP(A1,B1:C10,2,FALSE))
If you don't mind that, then just use that technique.
If you're using other macros in your sheet and/or you don't mind adding a new function into your sheet, there is a simpler formula, but the end result will be exactly the same. Using it would mean macros would have to be active which is why I mentioned it.
To do this:
Press Alt-F11 to open the VBEditor
Click on Insert > Module to open a standard module window
Paste in this code:
Function IFERROR(ToEvaluate As Variant, Default As Variant) As Variant
If IsArray(ToEvaluate) Then
IFERROR = IIf(IsError(ToEvaluate(1)), Default, ToEvaluate)
Else
IFERROR = IIf(IsError(ToEvaluate), Default, ToEvaluate)
End If
End Function
Press Alt-F11 to close the editor
Save your sheet.
Now you can use a simple "once through" formula like this;
=IFERROR(VLOOKUP(A1,B1:C10,2,FALSE),"-")
Bookmarks