SEARCH(find_text, within_text [,start_num])

Returns the position of a substring within a larger text string.

find_textThe text string you want to find.
within_textThe text in which you want to search for "find_text".
start_num(Optional) The 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.
* This function supports wildcards (? or *).
* Wildcard character: ? = a single character.
* Wildcard character: * = multiple characters.
* This function will always return the first instance of the text you want to find, reading from left to right.
* If "find_text" does not appear in "within_text", then #VALUE! is returned.
* If "start_num" > the length of "within_text", then #VALUE! is returned.
* If "start_num" < 0, 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.
* You can use the FIND function to return the position of a substring within a larger text string. This is case sensitive.
* You can use the MID function to return a text string which is a substring of a given string.
* You can use the REPLACE function to return a text string with a number of characters replaced.
* You can use the SUBSTITUTE function to return the text string with a substring substituted for another substring.
* You can use the SEARCHB function if you have languages that use the double-byte character set.
* The SEARCHB function does not appear in the autocomplete but does exist.
* For the Microsoft documentation refer to support.office.com

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

1 - What is the position of the first instance of the substring "e" in the text string "Statements" starting at character position 1.
2 - What is the position of the first instance of the substring "e" in the text string "Statements" starting at character position 4.
3 - What is the position of the first instance of the substring "e" in the text string "Statements" starting at character position 6.
4 - What is the position of the first instance of the substring "S" in the text string "Statements" starting at character position 1.
5 - What is the position of the first instance of the substring "s" in the text string "Statements" starting at character position 1.

© 2019 Better Solutions Limited. All Rights Reserved. © 2019 Better Solutions Limited Top