SEARCH Function in Excel: Complete Tutorial with Examples

SEARCH finds text position within cells, works case-insensitively, supports wildcards, and combines with other functions for powerful data extraction tasks.

Need to find where text appears within a cell? SEARCH returns the position of a substring, making it perfect for locating characters, extracting data, or checking if text exists. It’s case-insensitive and supports wildcards.

What Makes SEARCH Useful

SEARCH pinpoints text location instantly:

  • Find text position – Get the exact character number where text starts
  • Case-insensitive – Finds “ABC”, “abc”, or “Abc” the same way
  • Wildcard support – Use * and ? for flexible pattern matching
  • Extract data – Combine with other functions to pull substrings
  • Validation checks – Verify if specific text exists anywhere in a cell
The Syntax
=SEARCH(find_text, within_text, [start_num])

Find_text is what you’re looking for. Within_text is where you’re searching. Start_num is optional (which character to start from).


Example 1: Basic Text Location

Find where “Inc” appears in company names:

Formula: =SEARCH("Inc", A2)

Result in B2: 6 (starts at character 6)

Result in B3: #VALUE! (not found)

Result in B4: 10


Example 2: Case-Insensitive Search

SEARCH ignores case differences:

Formula: =SEARCH("hello", A2)

Result for all three: 1

All three return 1 because SEARCH treats uppercase and lowercase the same.


Example 3: Wildcard Pattern Matching

Find email domains using wildcards:

Formula: =SEARCH("@*.com", A2)

Result in B2: 5 (@ found at position 5)

Result in B3: #VALUE! (ends in .co.uk, not .com)

The asterisk (*) matches any characters between @ and .com.


Example 4: Extracting Data After a Delimiter

Find the position of a comma to extract last names:

Formula for position: =SEARCH(",", A2)

Result: 6

Formula to extract last name: =LEFT(A2, SEARCH(",", A2)-1)

Result: Smith


Example 5: Check if Text Exists

Verify if “urgent” appears anywhere in messages:

Formula: =IF(ISNUMBER(SEARCH("urgent", A2)), "Urgent", "Normal")

Result in B2: Urgent

Result in B3: Normal

Result in B4: Urgent (case-insensitive!)

ISNUMBER checks if SEARCH found the text (returns a number) or not (returns error).


Example 6: Starting Position Parameter

Search for the second occurrence of a character:

Formula for first dash: =SEARCH("-", A2)

Result: 6

Formula for second dash: =SEARCH("-", A2, 7)

Result: 13

Starting from position 7 skips the first dash.


Wildcards in SEARCH
SEARCH vs FIND

Example:

  • SEARCH("hello", "HELLO") = 1
  • FIND("hello", "HELLO") = #VALUE!
Common Use Cases

Email Validation Check if @ symbol exists in email addresses.

Data Extraction Find delimiters like commas or dashes to split text.

Category Detection Search for keywords to categorize data.

File Path Parsing Locate slashes or backslashes to extract folder names.

Practical Combinations

Extract text after a character:

=MID(A2, SEARCH("@", A2)+1, 100)

Gets everything after @.

Check for multiple terms:

=IF(OR(ISNUMBER(SEARCH("urgent",A2)), ISNUMBER(SEARCH("critical",A2))), "Priority", "Normal")

Find position of last occurrence:

=SEARCH("~", SUBSTITUTE(A2, "-", "~", LEN(A2)-LEN(SUBSTITUTE(A2,"-",""))))

Replaces the last dash with ~ then searches for it.

Common Mistakes to Avoid

Expecting Case Sensitivity

  • SEARCH(“ABC”, “abc”) finds it
  • Use FIND if you need case sensitivity

Forgetting Error Handling

  • SEARCH returns #VALUE! when text not found
  • Wrap in ISNUMBER or IFERROR

Wildcard Confusion

    • means any characters (0 or more)
  • ? means exactly one character
  • Don’t mix up their purposes
Error Handling

Check if text exists before using:

=IFERROR(SEARCH("text", A2), "Not found")

Use with IF:

=IF(ISNUMBER(SEARCH("keyword", A2)), "Found", "Not found")
Tips for Using SEARCH

Extract domain from email:

=MID(A2, SEARCH("@", A2)+1, LEN(A2))

Check file extension:

=IF(ISNUMBER(SEARCH(".pdf", A2)), "PDF", "Other")

Find text between characters:

=MID(A2, SEARCH("[", A2)+1, SEARCH("]", A2)-SEARCH("[", A2)-1)
When to Use SEARCH

Use SEARCH when:

  • Case doesn’t matter
  • You need wildcards
  • Looking for flexible patterns
  • Extracting parts of text

Use FIND when:

  • Case sensitivity is required
  • Exact matching needed
  • No wildcards necessary
Start Using It

Open a spreadsheet with text data. Pick a word or character to find. Type =SEARCH, specify what to find and where. See the position number returned.

SEARCH becomes essential for text manipulation and data cleaning.


Questions about SEARCH? Want to explore MID and LEFT for text extraction? Let’s connect.