SEARCH

SEARCH(find_text, within_text [,start_num])

Returns the starting position of a substring within a larger text string (not case sensitive).

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 (default is 1).

REMARKS
* This function is not case sensitive when searching for text strings.
* For a case sensitive search, use the FIND function.
* This function supports wildcards (? and *).
* Wildcard character: ? = a single character.
* Wildcard character: * = multiple characters.
* Wildcard character: * cannot be used to test for a substring that ends with a particular character. Example 13.
* To include the actual wildcard characters use a tilde prefix (~?), (~*) and (~~).
* 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.
* 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 the characters from the middle of a 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.
* You can use the TEXTAFTER function to return the characters from the end of a text string after a delimiter.
* For the Microsoft documentation refer to support.microsoft.com
* For the Google documentation refer to support.google.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! 
13=SEARCH("*a", "ababab") = 1 

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.
13 - This function always looks for substrings and will automatically prefix and append an asterisk to your "find-text".

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