Excel SEARCH function returns an integer that represents the position of a specified character or substring within a text. In this guide, we’re going to show you how to use the Excel SEARCH function and also go over some tips and error handling methods.


Supported versions

  • All Excel versions

SEARCH Syntax

SEARCH(find_text, within_text, start_num)


Arguments

find_text The character or the substring you want to find.
within_text The text that contains the character or substring you want to find.
start_num Optional. The position of the character that you want to start to look. If it is omitted, the function starts to look from the first character.


Examples

Example 1

=FIND("a","Charizard")
 function returns 3 for position of the first occurrence of the character "a". The start_num argument is omitted to make the function to look from the first character.

SEARCH-Example-1

Example 2

=SEARCH("a","Charizard",4)
returns 7 for position of the first occurrence of the character "a" after the 4th character.

SEARCH-Example-2

Example 3

=SEARCH("z?rd","Charizard")
returns 6 for position of the first occurrence of the full string "z?rd". The "z?rd" represents a 4-character substring which starts with "z" and ends with "rd"/ The question mark is a wild character that tells the formula to search for any character in that slot.

SEARCH-Example-3

Example 4

=SEARCH("Z","Charizard")
returns 6 for the position of the first occurrence of the character "Z". Because the SEARCH function is not case-sensitive, uppercased"Z" character is a valid argument.

SEARCH-Example-4

Download Workbook


Tips

  • The SEARCH function is not case-sensitive and supports wildcard characters.
  • Use the asterisk (*) character to represent any sequence of characters.
  • Use the question mark (?) character to represent any single character.
  • Use the tilde (~) character before an * or a ? to search exactly for these characters.
  • Use the FIND function for case sensitive searches without wildcard support.
  • You can combine the SEARCH function with LEFT, MID, and RIGHT functions to locate and parse substrings.

Issues

#VALUE!

You will see a #VALUE! error if find_text is not found in within_text.