VLOOKUP Condition

  • Thread starter Thread starter lightbulb
  • Start date Start date
L

lightbulb

I'm trying to do a Vlookup where if it can't find the information in the
specified array, it returns a predetermined value...is there a way to do this?

Thanks!
 
Yes, when VLookup() doesn't find a match, it returns #N/A error and you can
test for that:

=IF(ISNA(yourVlookupFormula),predeterminedValue,yourVlookupFormula)

a real one might look like
=IF(ISNA(VLOOKUP(A1,Sheet2!B9:X109,3,False)),-55,VLOOKUP(A1,Sheet2!B9:X109,3,False))

You could even return text as:
=IF(ISNA(VLOOKUP(A1,Sheet2!B9:X109,3,False)),"No Match
Found",VLOOKUP(A1,Sheet2!B9:X109,3,False))
 
hi,

2 ways

=IF(COUNTIF(A1:A20,F1)>0,VLOOKUP(F1,A1:B20,2,FALSE),"My Pre defined value")

or

=IF(ISNA(VLOOKUP(F1,A1:B20,2,FALSE)),"My pre defined
value",VLOOKUP(F1,A1:B20,2,FALSE))

Mike
 

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

Similar Threads

Conditional Formatting 1
vlookup range 4
Excel IF statement with vlookup 2
VLOOKUP Problem 1
VLOOKUP problem 3
VLOOKUP Issue??? 4
vlookup part of string... 6
VLOOKUP to match substring 2

Back
Top