SEARCH (search for text)

<< Click to Display Table of Contents >>

SEARCH (search for text)

Syntax:

SEARCH(Text, SearchedText [, StartPos])

Description:

Returns the position of the text string SearchedText within the text string Text.

StartPos (optional) lets you specify the position (= character) at which to start the search. If omitted, the search starts at the first character.

The SEARCH function is not case-sensitive, i.e., it will not distinguish between uppercase and lowercase letters. To perform a case-sensitive search, use the FIND function instead.

Example:

SEARCH("a", "Banana") returns 2

SEARCH("A", "Banana") returns 2

SEARCH("a", "Banana", 3) returns 4

SEARCH("x", "Banana") returns a #VALUE! error value, since "x" does not occur in "Banana".

See also:

FIND, REPLACE, SUBSTITUTE, EXACT, MID