Skip to main content

Excel SEARCH function

Author: Xiaoyang Last Modified: 2020-02-23

In Excel, the SEARCH function can help you to find the position of a specific character or substring from the given text string as following screenshot shown. This tutorial, I will introduce how to use this SEARCH function in Excel.

 Syntax:

The syntax for the SEARCH function in Excel is:

=SEARCH (find_text, within_text, [start_num])

 Arguments:

  • find_text: Required. The character or text that you want to find.
  • within_text: Required. The text string that is to be searched within.
  • start_num: Optional. From which position you want to start the search within the text string. If this argument omitted, the search starts from the first character of the given text string.

Notes:

  • 1. SEARCH function will return the position of the first occurrence of find_text inside the text string if the start_num is omitted.
  • 2. SEARCH function is not case sensitive, if you need to do a case sensitive search, you should use the FIND function.
  • 3. If the value of find_text is not found, SEARCH function will return the #VALUE! error value.
  • 4. If the start_num is not greater than 0 or is greater than the length of the within_text, the #VALUE! error value is returned as well.
  • 5. The SEARCH function allows using wildcards in the find_text argument:
    • Question mark (?): matches one character;
    • Asterisk (*): matches any series of characters;
    • To find the actual question mark (?) or asterisk (*), type a tilde (~) before them, such as: ~*, or ~?.

 Return:

Return the location of the specific character or text from the given text string.


 Examples:

Example 1: Search for a character or text in a text string (from the beginning)

For searching a specific character or word in a text string to return its position from the first character beginning, please apply the below formula:

=SEARCH(B2, A2)

Note: In the above formula, B2 is the cell contains the character or text you want to find its position, A2 is the text string that you want to search from.

Then, you will get the position of the searched text from the beginning of the text string, see screenshot:


Example 2: Search for a character or text in a text string (with a specified beginning)

Sometime, you may want to get the position of a specific character within a text string from a specific beginning instead of the first character beginning. In this case, you just need to add the third start_num argument.

Please enter or copy the following formula into a blank cell:

=SEARCH(B2, A2,C2)

Note: In the above formula, B2 is the cell contains the character or text you want to find it position, A2 is the text string that you want to search from, and C2 is the number where you want to start the search within the text string.

And then, the positions of the character or text within the text string from where you want to start the search have been returned, see screenshot:


Example 3: Find and extract the text between parentheses

If you have a list of text strings which some texts are enclosed with the parentheses, now, you just want to extract the text between the parentheses, here, the SEARCH function combining the MID function can help you to solve this job.

Please apply the following formula into a blank cell:

=MID(A2,SEARCH("(",A2)+1, SEARCH(")",A2)-SEARCH("(",A2)-1)

And all the texts between the parentheses have been extracted at once, see screenshot:


 More Functions:

  • Excel REPLACE Function
  • The REPLACE function can help you to Find and replace characters based on given location from text string with a new text.

The Best Office Productivity Tools

Kutools for Excel - Helps You To Stand Out From Crowd

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates  |  Delete Blank Rows  |  Combine Columns or Cells without Losing Data  |  Round without Formula ...
Super VLookup: Multiple Criteria  |  Multiple Value  |  Across Multi-Sheets  |  Fuzzy Lookup...
Adv. Drop-down List: Easy Drop Down List  |  Dependent Drop Down List  |  Multi-select Drop Down List...
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  Compare Columns to Select Same & Different Cells ...
Featured Features: Grid Focus  |  Design View  |  Big Formula Bar  |  Workbook & Sheet Manager | Resource Library (Auto Text)  |  Date Picker  |  Combine Worksheets  |  Encrypt/Decrypt Cells  |  Send Emails by List  |  Super Filter  |  Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters ...)  |  50+ Chart Types (Gantt Chart ...)  |  40+ Practical Formulas (Calculate age based on birthday ...)  |  19 Insertion Tools (Insert QR Code, Insert Picture from Path ...)  |  12 Conversion Tools (Numbers to Words, Currency Conversion ...)  |  7 Merge & Split Tools (Advanced Combine Rows, Split Excel Cells ...)  |  ... and more

Kutools for Excel Boasts Over 300 Features, Ensuring That What You Need is Just A Click Away...

Description


Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)

  • One second to switch between dozens of open documents!
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Edge and Firefox.
Comments (0)
No ratings yet. Be the first to rate!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations