The Excel SEARCH Function

Related Function:
FIND function

Basic Description

The Excel SEARCH function returns the position of a specified character or sub-string within a supplied text string. The function is not case-sensitive.

If you want to perform a case-sensitive search, use the Excel Find function instead.

The syntax of the Search function is :

SEARCH( search_text, within_text, [start_num] )

Where the function arguments are:

search_text-The character or sub-string that you wish to search for
within_text-The text string that is to be searched

An optional argument that specifies the position in the within_text string, from which the search should begin

If omitted, this takes on the default value of 1 (i.e. begin the search at the start of the within_text string)


You can also use the following wildcards in the search_text argument:

?    -    matches any single character
*    -    matches any sequence of characters

eg. the condition "A*e" will match any substring beginning with "A" and ending in "e".

If the supplied search_text is found, the Search function returns a number, representing the position of the search_text in the within_text. If the supplied search_text is not found, the function returns the Excel #VALUE! error.

Search Function Examples

The following spreadsheet shows examples of the Excel Search function used to search for various characters within the text string "Original Text".


1Original Text=SEARCH( "T", A1 )
2Original Text=SEARCH( "t", A2 )
3Original Text=SEARCH( "i", A3 )
4Original Text=SEARCH( "i", A4, 4 )


1Original Text10
2Original Text10
3Original Text3
4Original Text5

Note that, in the above examples:

Further information and examples of the Excel Search function can be found on the Microsoft Office website.

Search Function Error

If you get an error from the Excel Search function this is likely to be the #VALUE! error:

Common Error

Occurs if either:

  • the supplied search_text is not found in the supplied within_text string;
  • the supplied [start_num] is less than zero or is greater than the length of the supplied within_text string.