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

I like it! Maybe not for this spreadsheet, but as I change over my old
FoxBase programs to Excel and Access, I can see being able to display
different messages coming in very handy.
Thanks!

"Gary L Brown" wrote:

You can even get fancier if you want to see a message instead of #NA...

=IF(ISNA(VLOOKUP(A14, Sheet4!$A$66:$B$70, 2, FALSE)),"Not
Found",VLOOKUP(A14, Sheet4!$A$66:$B$70, 2, FALSE))

- if the vLookup can't find the value and returns an #NA, 'Not Found' is
shown instead, otherwise it returns the value.

HTH,
--
Gary Brown

If this post was helpful, please click the ''Yes'' button next to ''Was this
Post Helpfull to you?''.


"Kim Greenlaw" wrote:

It works, it works, it works. Wish I had posted this question before I spent
so much time on it. Thank you very, very much.

"Kleev" wrote:

use the false argument:
=VLOOKUP(A14, Sheet4!$A$66:$B$70, 2, FALSE)
if no match, it will return #N/A

"Kim Greenlaw" wrote:

If lookup doesn't find a match in the first column, can I get it to return an
"ERR" or "0", something that would let me know there was no match? Right now
it returns the value in the second column of the closest value.