Leading the way in Microsoft Office Development
 Home|Excel|Word|PowerPoint|Consultancy|Feedback|Contact 
 Microsoft Excel > Functions > Text > SEARCH

 

SEARCH(find_text, within_text [,start_num])

 
 Returns the number of the character at which a character or text string is first found (reading from left to right).

 find_textThe text string you want to find.
 within_textThe text in which you want to search for "find_text".
 start_numThe character number in "within_text" at which to start searching.

 REMARKS
 
  • This function is not case sensitive. For a case sensitive search, use the FIND() function.
     
  • If "find_text" does not appear in "within_text", then #VALUE! is returned.
     
  • The "find_text" can include wildcards: ? = a single character, * = multiple characters.
     
  • If "start_num" > the length of "within_text", then #VALUE is returned.
     
  • If "start_num" < 0, then #VALUE! is returned.
     
  • If "start_num" is left blank, then 1 is used.
     
  • If you want to find an actual question mark or asterisk, type a tilde (~) before the character.
     
  • Any blank spaces or punctuation marks count as individual characters.
     
  • This function is often used in conjunction with the MID() or REPLACE() functions to change the text.
     
  • There is also a SEARCHB() function which can be used with languages that use the double-byte character set.

     EXAMPLES
     
     AB
    1=SEARCH("e","Statements",6) = 7margin
    2=SEARCH("e","Statements",1) = 5profit margin
    3=SEARCH("e","Statements",4) = 5 
    4=SEARCH(B1,B2) = 8 
    5=SEARCH("e","ABCDEF") = 5 
    6=SEARCH("a?b","AEB") = 1 
    7=SEARCH("a*e","abbbbbe") = 1 
    8=SEARCH("z","abcd") = #VALUE! 
    9=SEARCH("a","abcdef",10) = #VALUE! 
     

     Functions - S | Index - S | Text Manipulation | Office Online 

     Copyright © 2004-2007 Better Solutions Limited. All Rights Reserved.Top