code to detect data NOT FOUND when using LOOKUP


Posted by Sergio on February 12, 2002 10:56 AM

I'm trying to find some code that will tell me when some data is not found on a table when using LOOKUP. Right now if the value (date) is not found on the table it gives me a result as if it was found!
This is a part of the table:
C D
DATE MULT
09/02/2002 2
10/02/2002 2
. .
. .

At say A1: =LOOKUP(B2;C2:C10;D2:D10)

B column is where I have the dates to be looked up.

Posted by Aladin Akyurek on February 12, 2002 11:04 AM

You can also use:

=IF(COUNTIF(C2:C10,B2),VLOOKUP(B2,C2:D10,2,0),"Not Found")

==========



Posted by Sergio on February 12, 2002 12:02 PM

Re: Thanks, it works great!