Vlookup Error

M

mick.smith1964

Hi

I have alot of Vlookup functions in a worksheet. Some return values, others
do not which results in #N/A in the cell.

Is there a way to avoid #N/A being returned. All I want is either a positive
value or an empty cell.

Thanks for any suggestions
 
B

Bob Phillips

Hi Mick,

One way

=IF(ISNA(lookup_formula),"",lookup_formula)

this traps #N/A errors specifically, a more generic solution is

=IF(ISERROR(lookup_formula),"",lookup_formula)

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
O

Ola

Hi,

Try this: =LOOKUPV(C1,A1:B100,2,0,"")


But first
1. Press Alt+F11. Insert Module. Copy and Paste the below.

Function LookupV(Lookup_Value, Table_Array As Range, Col_Index_Num,
Range_value, Optional Error_Msg)
LookupV = Application.VLookup(Lookup_Value, Table_Array, Col_Index_Num,
Range_value)
If IsError(LookupV) And Not IsMissing(Error_Msg) Then LookupV =
Error_Msg
End Function

The LOOKUPV formula is Shorter and is Faster then VLOOKUP
Make sure the VBA code is only 4 rows!

Regards,
Ola
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Multiple VLOOKUP in an IF statement 2
ISERROR on VLOOKUP 3
Same forumula returns both 0 & N/A 2
Vlookup 1
VLookup + IF 5
Sum the results of a vlookup 6
wdActiveEndSectionNumber 1
Multiple IF Statement 2

Top