Link to home
Start Free TrialLog in
Avatar of Edward Pamias
Edward PamiasFlag for United States of America

asked on

Vlookup return 0 instead of N/A

When I copy my vlookup formula down I get either a number or N/A. Instead of the N/A I want a formula that would return a 0. My vlookup formula is below.

=VLOOKUP(A3,Sheet4!$A$4:$B$32,2,FALSE)

I found this formula below on a website...and I tried to modify it for my use but it did not work.

=IF(COUNTIF($B$2:$B$100,A1), VLOOKUP(A1,$B$2:$D$100,3,0),””) (this is not my modified version)

Any help would be appreciated.

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Lee Wadwell
Lee Wadwell
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
the formula below returns 0 if A3 is blank - is this what you want?

=IF(ISBLANK(A3),0,VLOOKUP(A3,Sheet4!$A$4:$B$32,2,FALSE))
Hi, epamias.

=IFERROR(VLOOKUP(A3,Sheet4!$A$4:$B$32,2,FALSE),0)

This has...
... the advantage that the data is searched only once. (Trivial in this case, but often significant)
... the disadvantage that IFERROR didn't exist before Excel 2007.

Regards,
Brian.
Avatar of Edward Pamias

ASKER

Thank you! This one worked. The last formula worked as well. Sorry I did not see that until after I accepted the ISNA formula.
Not a problem, epamias. Glad you're sorted.