Return a 0 when vlookup returns #n/a

  • Thread starter Thread starter brian.baker13
  • Start date Start date
B

brian.baker13

Hi

I am doing a vlookup on cell a12 which looks up the entry from a12 in
another tab. When the info from cell a12 is not in the other tab
reference I am looking up I get a #n/a error. I would like to return a
zero or a blank when the lookup does not return a match from cell a12

=VLOOKUP($A12,Sheet2!$D$15:$N$244,B$3,0)

Please help.

Regards

Brian
 
Hi Brian, try it this way:

=IF(ISNA(VLOOKUP($A12,Sheet2!$D$15:$N$244,B
$3,0)),"",VLOOKUP($A12,Sheet2!$D$15:$N$244,B$3,0))

You can change the "" in the middle to 0 if you prefer that.

Hope this helps.

Pete
 
=if(isna(vlookup(...)),"",if(vlookup(...)="","",vlookup(...))))

or

=if(iserror(1/len(vlookup(...)),"",vlookup(...))
 
Back
Top