Excel Search Function

This post will guide you how to use Excel SEARCH function with syntax and examples in Microsoft excel.

Description

The Excel SEARCH function returns the number of the starting location of a substring in a text string. So you can use the SEARCH function to locate a text string within another text string and returns the position of the first character of find_text within text.

The SEARCH function is a build-in function in Microsoft Excel and it is categorized as a Text Function.

The SEARCH function is available in Excel 2016, Excel 2013, Excel 2010, Excel 2007, Excel 2003, Excel XP, Excel 2000, Excel 2011 for Mac.

Syntax

The syntax of the SEARCH function is as below:

= SEARCH (find_text, within_text,[start_num])

Where the SEARCH function arguments are:

  • find_text -This is a required argument. The substring that you want to find
  • within_text -This is a required argument. The text string in which you want to search for the substring (find_text).
  • Start_num -This is an optional argument. The starting position to search.

Note:

  • If find_text string is not found, the search function will return the #VALUE! Error value.
  • If start_num value is omitted, it is set to be 1 by default.
  • The SEARCH function is not case-sensitive.
  • The SEARCH function support wildcard characters.

Excel SEARCH Function Examples

The below examples will show you how to use Excel SEARCH Text function to get the position of substring in a text string.

#1 To get the position of “excelhow” text string in B1 cell, starting at the second position, just using formula:= SEARCH(“excelhow”,B1,2).

excel function search example1

2# The search function use wildcard characters to look for a string starts with “ex”characters in cell B1, using the following formula:

excel function search example2

Excel SEARCH Formula Examples

  • Check If Cell Contains All Values from Range
    If you want to check if a cell contains all values in a list, you can use a combination of the SEARCH function, the SUMPRODUCT function, the ISNUMBER function and COUNTA function…
  • Check if Cell Contains Certain Values but do not Contain Others Values
    Supposing that you have a list of text strings in the range B1:B3 and you need to check each Cell that if it contains one of several values in a range D2:D4 but do not contains any of values in range E2:E3….
  • Get first match that cell contains one of several values in a range
    You can use a combination of the INDEX function, the MATCH function, the ISNUMBER function and the SEARCH function to create a new excel array formula to get first match cell contains…
  • Get last match that cell contains one of several values in a range
    If you want to check a cell that if it contains one of several values in a range, you can use the SEARCH function to search find_text in a range inside a text string. Then we can use the LOOKUP function to get the last match values….
  • Check if Cell contains one of many values from range
    Assuming that you have a list of text strings in the range B1:B3 and you want to check each text string if it contains one of several values in a range E1:E3. If it contains any of text string in range E1:E3, then it should be return TRUE value, otherwise, it should return FALSE….
  • Extract Text between Brackets
    If you want to extract text between brackets in a cell, you need to create a formula based on the SEARCH function and the MID function….
  • Extract Text between Parentheses
    If you want to extract text between parentheses in a cell, then you can use the search function within the MID function to create a new excel formula…
  • Split Text String by Specified Character in Excel
    you can use the FIND function or SEARCH Function to get the position of the searched character within another string. Once you got the position number of the specified character, you can use the LEFT function to extract all the characters to the left of dash character (“-“)……
  • The different between FIND and SEARCH functions
    There are two big differences between FIND and SEARCH functions in excel.The FIND function is case-sensitive. And the SEARCH function is case-insensitive.The FIND function is not allow to use wildcard. But the SEARCH function is allow to use wildcard characters…..
  • Sort Cells by Specific word or words
    how to sort cells or text values in a column based on a specific word even if the word is in the text string in the cell. How do I sort cells in a column by the number of a specific word or words in excel……
  • Insert The File Path and Filename into Cell
    If you want to insert a file path and filename into a cell in your current worksheet, you can use the CELL function to create a formual……..
Related Posts

If Cell Contains Certain Text OR Equals Certain Text

IF cell equals certain text IF function is frequently used in Excel worksheet to return “true value” or “false value” based on the logical test result. If you want to test values to see if they equal certain text like ...

How to Extract Text between Two Text Strings in Excel
extract text between two words1

This post will guide you how to extract text between two given text strings in Excel. How do I get text string between two words with a formula in Excel. Extract Text between Two Text Strings Assuming that you have ...

How to Return a Value If a Cell Contains a Specific Text in Excel
return value if cell contains certain value2

This post will guide you how to return a value if a cell contains a certain number or text string in Excel. How do I check if a Cell contains specific text and then return another specific text in another ...

Insert The File Path and Filename into Cell
insert filepath filename in cell5

This post will guide you how to insert the file path and filename into a cell in Excel. Or how to add a file path only in a specified cell with a formula in Excel. Or how to add the ...

Sort Cells by Specific word or words
sort cells by specific words5

This post will guide you how to sort cells or text values in a column based on a specific word even if the word is in the text string in the cell. How do I sort cells in a column ...

Highlight Rows
highlight rows9

This post will teach you how to highlight rows in a table with conditional formatting in Excel. You will learn that how to change the color of the entire rows if the value of cells in a specified column meets ...

How to replace all characters after the first specific character
replace after first commas3

This post will guide you how to replace all characters after the first match of a specific character with a new text string in excel. How to replace all substrings after the first occurrence of the comma character with another ...

How to extract text after the second or nth specific character (space or comma)
extract text after second comma2

In the previous post, we talked that how to extract text after the first occurrence of the comma character in excel. And this post explains that how to get a substring after the second or nth occurrence of the comma ...

How to extract text before the second or nth specific character (space or comma)
extract text before second comma4

Before we talked that how to extract text before the first space or comma character in excel. And this post will guide you how to extract a substring before the second or nth specific character, such as: space or comma ...

How to extract text after first comma or space
extract text after first comma11

In the previous post, we talked that how to extract substring before the first comma or space or others specific characters in excel. And this post will guide you how to extract text after the first comma or space character ...

Sidebar