Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return zeros instead of #N/A on VLOOKUP 1

Status
Not open for further replies.

ranebow

Programmer
Mar 8, 2003
110
US
Is there a way to return either blanks or zeros on a VLOOKUP when you don't get a hit?

I'm doing a lookup from a "chart of accounts total sheet" to each month's expenses. If I don't get a hit I don't want to see the #N/A on my sheet. The #N/A also gives me problems when trying to total that column.

Any suggestions?
 
Use the IsError or IsNa function. It will look like this:

[COLOR=blue white]=if(isna(yourVLookup),0,yourVLookup)[/color]

[tt]_____
[blue]-John[/blue]
[/tt][red]"If you're flammable and have legs, you are never blocking a fire exit."[/red]
-Mitch Hedberg

Help us help you. Please read FAQ181-2886 before posting.
 
Ok, I'm still having problems.

I've entered anotherhiggins formula and keep getting an error.
 
Here's my formula:


=if(isna(VLOOKUP(A3,AprilPivot!$D$5:$E$24,2,false),0,VLOOKUP(A3,AprilPivot!$D$5:$E$24,2,false))
 
Ranebow,

Your formula should read:

=if(isna(VLOOKUP(A3,AprilPivot!$D$5:$E$24,2,false)),0,VLOOKUP(A3,AprilPivot!$D$5:$E$24,2,false))

notice the second ) halfway the formula

Kind regards,

Marcel Kreijne
Quandan - Steunpunt voor spreadsheetgebruikers
(Quandan - Dutch supportsite for spreadsheetusers)
 
You are missing a close parenthesis. Try this:

[COLOR=blue white]=if(isna(VLOOKUP(A3,AprilPivot!$D$5:$E$24,2,false)[highlight])[/highlight],0,VLOOKUP(A3,AprilPivot!$D$5:$E$24,2,false))[/color]

[tt]_____
[blue]-John[/blue]
[/tt][red]"I'm against picketing, but I don't know how to show it."[/red]
-Mitch Hedberg

Help us help you. Please read FAQ181-2886 before posting.
 
THANK YOU!!!!

That is exactly what I want it to do!
 
Glad we could help!
[cheers]

[tt]_____
[blue]-John[/blue]
[/tt][red]"I'm against picketing, but I don't know how to show it."[/red]
-Mitch Hedberg

Help us help you. Please read FAQ181-2886 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top