totn Excel Functions

MS Excel: How to use the SEARCH Function (WS)

This Excel tutorial explains how to use the Excel SEARCH function with syntax and examples.

Description

The Microsoft Excel SEARCH function returns the location of a substring in a string. The search is NOT case-sensitive.

The SEARCH function is a built-in function in Excel that is categorized as a String/Text Function. It can be used as a worksheet function (WS) in Excel. As a worksheet function, the SEARCH function can be entered as part of a formula in a cell of a worksheet.

Syntax

The syntax for the SEARCH function in Microsoft Excel is:

SEARCH( substring, string, [start_position] )

Parameters or Arguments

substring
The substring that you want to find.
string
The string to search within.
start_position
Optional. It is the position in string where the search will start. The first position is 1.

Returns

The SEARCH function returns a numeric value. The first position is 1.
If the SEARCH function does not find a match, it will return a #VALUE! error.

Applies To

  • Excel for Office 365, Excel 2019, Excel 2016, Excel 2013, Excel 2011 for Mac, Excel 2010, Excel 2007, Excel 2003, Excel XP, Excel 2000

Type of Function

  • Worksheet function (WS)

Example (as Worksheet Function)

Let's look at some Excel SEARCH function examples and explore how to use the SEARCH function as a worksheet function in Microsoft Excel:

Microsoft Excel

Based on the Excel spreadsheet above, the following SEARCH examples would return:

=SEARCH("bet", A1)
Result: 6

=SEARCH("BET", A1, 3)
Result: 6

=SEARCH("e", A2)
Result: 2

=SEARCH("e", A2, 1)
Result: 2

=SEARCH("e", A2, 3)
Result: 9

=SEARCH("in", A2, 6)
Result: #VALUE!

=SEARCH("cel", "Excel", 1)
Result: 3