SEARCHTEXT(find_text, within_text, start_num)

The SEARCHTEXT function finds one text string within another and returns the position of the character at which the two text strings first match.

SEARCHTEXT is case-insensitive and allows wildcard characters (* or ?) (This differs from FINDTEXT – see FINDTEXT). If you wish to search for the characters * or ? themselves, use ~* or ~?.

find_text is the text you wish to find. If find_text is "" (empty) the position of the character at start_num is returned.

within_text is the object text.

start_num is the position of the character in within_text from which you want to begin the search. If start_num is omitted it is assumed to be 1.

The #VALUE error message is returned if SEARCHTEXT fails to find a match.

For example,

=SEARCHTEXT("br", "AbraCADaBRa", 5) returns 9

=SEARCHTEXT("r", "Robertson", 1)  returns 1

=SEARCHTEXT("R*t", "Robertson", 1)  returns 1

=SEARCHTEXT("", "Mr Smith", 4)  returns 4

=SEARCHTEXT("~*", "XXXX*XX")  returns 5

See also:

Other text functions