On 2002-03-15 13:05, huorsa wrote:
I am using the vlookup function and sometimes I get the !#N/A. What can I do to change the !#N/A result for zero.
Thanks
If your match-type is FALSE, use:
=IF(COUNTIF(D2:D5,A1),VLOOKUP(A1,D2:E5,2,0),0)
where D2:D5 is the range that houses the lookup table, A1 a lookup value, D2:D5 within COUNTIF is the 1st column of the lookup table. By the way, 0 in VLOOKUP stands for FALSE, a shorter way of saying the same.
If your match-type is TRUE, use:
=IF(ISNUMBER(MATCH(A1,D2:D5)),VLOOKUP(A1,D2:E5,2),0)
Aladin