Enrollment for the FMVA™ Certification Program is now OPEN!

SEARCH Function

Returns the position of a specified character or sub-string within a supplied text string

What is the SEARCH Function?

The SEARCH function is categorized under TEXT functions. SEARCH will return the position of a specified character or sub-string within a supplied text string.

In financial analysis, the SEARCH function can be useful if we wish to find the location of a text in a string. For example, we can use the function to find the position of the letter “n” in the word “name.”

 

Formula

=SEARCH( search_text, within_text, [start_num] )

 

The SEARCH function uses the following arguments:

  1. Search_text (required argument) – It is the character or sub-string we wish to search.
  2. Within_text (required argument) – It is the text string that we need to search.
  3. Start_num (optional argument) – It specifies the position the within_text string, from which the search should begin.

If we omit the argument, it will take on the default value of 1, that is, it will begin the search at the start of the within_text string.

 

How to use the SEARCH Function in Excel?

As a worksheet function, SEARCH can be entered as part of a formula in a cell of a worksheet. To understand the uses of the function, let us consider an example:

 

Example

Suppose we imported data from an external source and we wish to find certain characters from the values given below:

 

SEARCH Function

 

The results in Excel are given in the screenshot below:

 

SEARCH Function - Example

 

Few notes about the SEARCH Function:

1. #VALUE! error – Occurs when:

a. The given search_text is not found in the supplied within_text string.

b. The given [start_num] is less than zero or is greater than the length of the supplied within_text string.

2. We can use the following wildcards in the search_text argument:

a. ? – Matches any single character.

b. * – Matches any sequence of characters. For example, the condition “A*e” will match any substring beginning with “A” and ending in “e.”

3. The FIND function doesn’t support case-sensitivity or use of wildcards so we can use the SEARCH function to search without case-sensitivity and/or to use wildcards.

 

Click here to download the sample Excel file

 

Additional resources

Thanks for reading CFI’s guide to important Excel functions! By taking the time to learn and master these functions, you’ll significantly speed up your financial modeling. To learn more, check out these additional resources:

Free Excel Tutorial

To master the art of Excel, check out CFI's FREE Excel Crash Course, which teaches you how to become an Excel power user.  Learn the most important formulas, functions, and shortcuts to become confident in your financial analysis.  

Launch CFI’s Free Excel Course now to take your career to the next level and move up the ladder!