Add to formula to put a zero in cell

A

Alberta Rose

Hi. I have this formula =VLOOKUP($A418,'Dec 07'!$F$13:$N$2000,5,FALSE). At
the moment if there is no amount in the lookup, a #N/A is returned to my
summary sheet. Then I have to go in and delete all the #N/A's before some of
the summing will work. Is there something I can add to this formula so that
a zero is populated if nothing is found?

Thanks...Laurie
 
D

Dave Peterson

=if(isna(vlookup(...)),0,vlookup(...))

Or if you're using xl2007:
=iferror(vlookup(...),0)
 
A

Alberta Rose

why is there two vlookups?

=if(isna(VLOOKUP($A418,'Dec 07'!$F$13:$N$2000,5,FALSE))

where in this string would i put the zero?
 
G

Gord Dibben

One vlookup is the if part, the other is the then part

=IF(ISNA(VLOOKUP($A418,'Dec
07'!$F$13:$N$2000,5,FALSE)),"",VLOOKUP($A418,'Dec
07'!$F$13:$N$2000,5,FALSE))

This formula return a blank-looking cell.

If you want a zero simply change the "" to 0


Gord Dibben MS Excel MVP
 

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

Top