VLookup Value not found ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using the following:

=VLOOKUP($A15,$A$81:$AB$124,Q$1,FALSE)+VLOOKUP($A15,$A$126:$AB$160,Q$1,FALSE)

Where $A15 may not exist in either of the arrays or only in one of the two.

How do I allow for this so I get a value rather than the #N/A?

Thanks in advance
 
I'm not sure if this will work, but try it

=SUMPRODUCT(--(OFFSET(Sheet1!$A15,0,Sheet1!$Q$1,146,1)=$A$15),(OFFSET(Sheet1!$A15,0,Sheet1!$Q$1,146,1)))

HTH,
Barb Reinhardt
 
You can check each portion to see if it returns an error first:

=if(isna(firstvlookup),0,firstvlookup)
+if(isna(2ndvlookup),0,2ndvlookup)

If you're using xl2007, you could look at =iferror() in excel's help. You won't
have to duplicate each vlookup formula.
 
Thank you both, the ISNA function is what I used successfully, another lesson
learned!
--
Jeff C
Live Well .. Be Happy In All You Do


Dave Peterson said:
You can check each portion to see if it returns an error first:

=if(isna(firstvlookup),0,firstvlookup)
+if(isna(2ndvlookup),0,2ndvlookup)

If you're using xl2007, you could look at =iferror() in excel's help. You won't
have to duplicate each vlookup formula.
 
Try this:

=SUMIF(A81:A124,A15,INDEX(A81:AB124,,Q1),0)+SUMIF(A126:A160,A15,INDEX(A126:AB160,,Q1),0)
 
Ooops!

Typo:
=SUMIF(A81:A124,A15,INDEX(A81:AB124,,Q1),0)+SUMIF(A126:A160,A15,INDEX(A126:AB160,,Q1),0)

Should be:

=SUMIF(A81:A124,A15,INDEX(A81:AB124,,Q1))+SUMIF(A126:A160,A15,INDEX(A126:AB160,,Q1))


--
Biff
Microsoft Excel MVP


T. Valko said:
Try this:

=SUMIF(A81:A124,A15,INDEX(A81:AB124,,Q1),0)+SUMIF(A126:A160,A15,INDEX(A126:AB160,,Q1),0)
 
Just a warning...

If the value in A15 occurs multiple times in A81:a124 or multiple times in
A126:A160, then this formula may not return what the original poster needs.




T. Valko said:
Ooops!

Typo:
=SUMIF(A81:A124,A15,INDEX(A81:AB124,,Q1),0)+SUMIF(A126:A160,A15,INDEX(A126:AB160,,Q1),0)

Should be:

=SUMIF(A81:A124,A15,INDEX(A81:AB124,,Q1))+SUMIF(A126:A160,A15,INDEX(A126:AB160,,Q1))
 
Back
Top