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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Query: VLookup gives #N/A

Status
Not open for further replies.

flaviooooo

Programmer
Joined
Feb 24, 2003
Messages
496
Location
FR
Hey, I have a problem in Excel 97. I have a query on a table. Now i have to get some figures from several months in a year, but if the month is not in the table, then i get a #N/A in the cell. I'd rather have a 0 then.
I use following code to get the data:
IF(VLOOKUP(J$21;$P$2:$BK$13;4;FALSE) in which J$21 contains the number of the month, and $P$2:$BK$13 is the range.

can I fix this problem with an IF-statement(i tried), or can i alter the table so that is automatically gives all 12 months when i query it...?

help! :)
 
=IF(ISNA(VLOOKUP(J$21;$P$2:$BK$13;4;FALSE)),0,VLOOKUP(J$21;$P$2:$BK$13;4;FALSE)) Rgds
Geoff
"Some cause happiness wherever they go; others whenever they go."
-Oscar Wilde
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top