Name

SEARCH

Synopsis

Use SEARCH to determine the location of the text string specified by Find_Text within the Within_Text string. The function starts searching at the location specified by Start_Num or at the beginning of the string if this argument is omitted.

To Calculate

=SEARCH(Find_Text, Within_Text, Start_Num)

The Find_Text and Within_Text arguments are required for this function. The Start_Num argument is optional.

Find_Text

Indicates the text that you want to locate. This text string can include wildcard characters (*, ?). To find strings that contain question marks or asterisks, you need to place a tilde (~) before the character.

Using Wildcards in a Search

You may have heard reference to the use of wildcard characters when performing a search. There are two wildcard characters that are typically used. The asterisk (*) matches any sequence of characters. For example, if you specify the string “mo*” it will match “mother,” “most,” and any other strings that begin with “mo”. The question mark (?) matches any one character. For example, you can specify “b?t” to match strings such as “bit” and “bat.”

Within_Text

Specifies the text string that you want to search.

Example

Figure 18-6 illustrates how SEARCH looks at the specified string of text and returns a character position of the indicated characters in the string. In that example, the function returns a value of 11 because that is where the first character in “Excel” is located in the string.

Get Excel 2000 in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.