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

VLOOKUP if value exists, avoid #N/A

Status
Not open for further replies.

simon551

IS-IT--Management
May 4, 2005
249
Hi,
I'm trying to pull values from a table that match an array of dates. If there is a date listed on the value table that matches my date, I'm ok, but if not I get the #N/A. Any help is appreciated.

=IF( VLOOKUP(A5,'Validation Sales'!A6:H1003,8,FALSE), VLOOKUP(A5,'Validation Sales'!A6:H1003,8,FALSE), IF(VLOOKUP(A5,'Validation Sales'!A6:H1003,3,FALSE), VLOOKUP(A5,'Validation Sales'!A6:H1003,3,FALSE),0))
 


if you have Excel 2007+ then...
[tt]
=iferror(VLOOKUP(A5,'Validation Sales'!A6:H1003,8,FALSE),0)
[/tt]
otherwise for 97-2003...
[tt]
=if(isna(match(A5,'Validation Sales'!A6:A1003,0),0,VLOOKUP(A5,'Validation Sales'!A6:H1003,8,FALSE))
[/tt]


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
You could use the COUNTIF function to check the existence of the Vlookup data or conditional formatting can solve the issue as well. Be wary of double Vlookups with an if statement it can cause major issue when dealing with a lot of data

HTH << MaZeWorX >> "I have not failed I have only found ten thousand ways that don't work" <<Edison>>
 


BOTH Ifs use the SAM LOOKUP VALUE!!! Therefore the second if is totally unnecessary.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
sorry I meant to say IF with isna and 2 lookups is the least effective ... which is a solution many may consider better yet put the formula in another cell and reference it with =IF(ISNA(A1),0,A1) assuming the formula is in A1 then hide the column

HTH << MaZeWorX >> "I have not failed I have only found ten thousand ways that don't work" <<Edison>>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top