Thread: SEARCH function
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
SteveG
 
Posts: n/a
Default SEARCH function


The SEARCH function looks up a value or text within a string and returns
the starting point of that value. So if in A1 you had the text "How are
you?" and you used

=SEARCH("are",A1,1)

it would return the number 5 as that is the starting point of the word
"are" within the text string starting with the first character which is
defined by the "1" in the formula.

If the value is not located in the string, it returns the #VALUE!
error. To avoid seeing this error you could use something like,

=IF(ISNUMBER(SEARCH("are",A1,1)),"Found","")

This would return the text "Found" if the word is found and a blank if
not.

SEARCH is not case sensitive. If you need your search to be case
sensitive, use the FIND function. Maybe post what you need to
accomplish and how you are trying to use the function so someone might
be able to assist.


HTH

Steve


--
SteveG
------------------------------------------------------------------------
SteveG's Profile: http://www.excelforum.com/member.php...fo&userid=7571
View this thread: http://www.excelforum.com/showthread...hreadid=522137