VLookup

  • Thread starter Thread starter Fitzi
  • Start date Start date
F

Fitzi

I am using the vlookup function. I want it to look up an exact match then
return the number zero if it does not find a match instead of #N/A.

Can you help?
 
Hi Fitzi,

=IF(ISNA(VLOOKUP(C2,$A$2:$B$20,2,FALSE)),"",VLOOKUP(C2,A2:B20,2,FALSE))


Not above is one line if it should break when posted.

Assumes:
C2 is the Lookup Value
A2:B20 is the table array

If lookup returns #N/A the a null ("") is used in lieu.
 
Hi again,

My apologies. So used to returning null if not found I did it in the
formula. Should be following to return zero if not found:

=IF(ISNA(VLOOKUP(C2,$A$2:$B$20,2,FALSE)),0,VLOOKUP(C2,A2:B20,2,FALSE))
 
And don't forget to make the second lookup table absolute also.

=IF(ISNA(VLOOKUP(C2,$A$2:$B$20,2,FALSE)),0,VLOOKUP(C2,$A$2:$B$20,2,FALSE))


Gord Dibben MS Excel MVP
 
Thanks for correcting that Gord. What would we do without observant people
like yourself looking over our shoulder and fixing our mistakes?
 
Back
Top