View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
John Michl
 
Posts: n/a
Default can lookup return err if no match found

If you are using the VLOOKUP or HLOOKUP functions you can add the
"False" condition which will return an error value if there isn't an
exact match. Unfortunately, this isn't available for LOOKUP. However,
you could use an IF statement like the following to accomplish the same
result.
A1: The value you want to find
B1:B10 The range to search
C1:C10 The range of the result to return

=IF(A1<LOOKUP(A1,B1:B10,B1:B10),"Not Found",LOOKUP(A1,B1:B10,C1:C10))

Hope that helps.

- John
www.JohnMichl.com