I am trying to create a Vlookup function with an additional argument to
return if the vlookup function evaluates to #N/A (Below is the code).
It works fine unless the function evaluates to #N/A.
I would greatly appreciate any help,
Michael
Function VLOOKUP_NA(VAL1, Range, OFFSET, TF, NAVALUE)
If WorksheetFunction.IsNA(WorksheetFunction.VLookup(VAL1, Range, OFFSET,
TF)) <> False Then
VLOOKUP_NA = NAVALUE
ElseIf WorksheetFunction.IsNA(WorksheetFunction.VLookup(VAL1, Range, OFFSET,
TF)) = False Then
VLOOKUP_NA = WorksheetFunction.VLookup(VAL1, Range, OFFSET, TF)
End If
End Function
2007-09-20
09:03:54
·
2 answers
·
asked by
msaathof
3