View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete_UK Pete_UK is offline
external usenet poster
 
Posts: 8,856
Default Can we use multiple if with VLookup function

Harlan,

thanks for the elaboration. I think the following would suffice for
what the OP wants:

=IF(ISNUMBER(SEARCH(" the "," "&A1&" ")),"yes","no")

Pete

Harlan Grove wrote:
Pete_UK wrote...
If you want to check if the word "the" appears in cell A1, you could
use this:

=IF(ISNUMBER(FIND("the",A1)),"yes","no")

...

Picky: this only tests for the SUBSTRING "the" in A1. In addition to
the word 'the' it'd also match their, then, another etc. To check for
the word 'the' in a cell requires something a bit more elaborate.

=IF(COUNT(SEARCH(MID(" "&A1&" ",FIND("the",A1)+{0,4},1),
"ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789"))=0,"yes", "no")

This defines 'word' as any token containing letters, numbers or
underscores. Any other characters delimit 'words'.