top of page

MS Excel: SEARCH function to find position of a text

  • Writer: Fakhriddinbek
    Fakhriddinbek
  • 4 days ago
  • 2 min read

The SEARCH function in Excel is used to find the position (as a number) of one text string within another. Unlike the FIND function, SEARCH is not case-sensitive and supports the use of wildcards, making it more flexible for general text searches.

It’s especially helpful when extracting, checking, or manipulating substrings in dynamic text operations.


Excel interface showing a blank spreadsheet. A "Function Arguments" dialog for the SEARCH function is open, displaying input fields and explanations.

Syntax


=SEARCH(find_text, within_text, [start_num])


Parameters:


Argument

Description

find_text

Required. The text you want to find.

within_text

Required. The text in which you want to search.

start_num

Optional. The position in the string to start the search. Default is 1.


Returns: A number indicating the position of find_text in within_text.


Examples with Tables


Example 1: Basic Search


=SEARCH("e", "Excel")


Formula

Result

=SEARCH("e", "Excel")

1


Explanation: The first occurrence of "e" is at position 1 in "Excel".


Example 2: Search Not Case-Sensitive


=SEARCH("X", "Excel")


Formula

Result

=SEARCH("X", "Excel")

2


Explanation: Unlike FIND, this function treats lowercase and uppercase equally.


Example 3: Start Search from a Specific Position


=SEARCH("e", "Experience", 5)


Formula

Result

=SEARCH("e", "Experience", 5)

8


Explanation: The first "e" after position 5 is at position 8.


Example 4: Using Wildcards


=SEARCH("ex?l", "excel")


Formula

Result

=SEARCH("ex?l", "excel")

1


Explanation: ? matches any single character (c in this case).


=SEARCH("e*l", "email label")


Formula

Result

=SEARCH("e*l", "email label")

1


Explanation: * matches any number of characters.


SEARCH vs FIND


Feature

SEARCH

FIND

Case sensitivity

❌ Not case-sensitive

✅ Case-sensitive

Wildcards supported

✅ Yes (?, *)

❌ No

Usage flexibility

More forgiving, more general

More exact matching


Use Cases


Scenario

How SEARCH Helps

Extracting parts of text

Find start positions for MID, LEFT, or RIGHT

Checking content existence

Combine with ISNUMBER or IF for logic checks

Data validation

Verify patterns in strings

Parsing structured data

Locate characters like “-”, “/”, or “@” in strings


Example: Extract Domain Name from Email



=RIGHT(A1, LEN(A1) - SEARCH("@", A1))


Step

Formula

Result

Find @ position

SEARCH("@", A1)

9

Get domain name

RIGHT(A1, LEN(A1) - 9)


Notes


  • If find_text is not found, Excel returns a #VALUE! error.

  • Wildcards only work in SEARCH, not in FIND.

  • Always use IFERROR() or ISNUMBER() to handle errors safely.


Example with Error Handling


=IFERROR(SEARCH("test", A1), "Not found")


Related Functions


Function

Description

FIND

Same as SEARCH but case-sensitive

MID

Extracts characters from the middle of a string

LEFT

Extracts the first N characters

RIGHT

Extracts the last N characters

LEN

Returns length of a text string

ISNUMBER

Checks if result is a number (used with SEARCH)


Summary


Feature

Description

Function Name

SEARCH

Purpose

Find position of substring in text

Case-sensitive

❌ No

Supports wildcards

✅ Yes (?, *)

Returns

Position as number or #VALUE! if not found


Final Thoughts


The SEARCH function is ideal for locating patterns or substrings inside text. It's especially useful in combination with extraction and logic functions like MID, LEFT, IF, and ISNUMBER—making it a powerful part of any data cleaning or parsing task in Excel.

Comentarios


bottom of page