SEARCH Function in Excel

Master the SEARCH function to find text within strings. Learn case-insensitive searching, wildcards, practical examples, and error solutions.

ExcelExcel
Google SheetsGoogle Sheets
text
intermediate
Syntax Preview
ExcelExcelGoogle SheetsGoogle Sheets
=SEARCH(find_text, within_text, [start_num])
Quick Answer
Comprehensive Explanation
Syntax and Parameters
How to Use SEARCH - Step by Step

Practical Examples

Basic Email Domain Search

Find the @ symbol position in email addresses

Result: 9

Case-Insensitive Product Code Search

Locate product codes regardless of case

Result: 1

Wildcard Pattern Matching

Use wildcards to find variable patterns

Result: 15

Finding Multiple Keywords

Check for presence of any keyword from a list

Result: Position or 0

Extract Domain from URL

Find and extract website domain using SEARCH

Result: www.example.com

Data Validation with Error Handling

Validate phone number format and provide feedback

Result: Valid Format

Common Errors and Solutions

#VALUE!

SEARCH cannot find the specified text

Cause:

The find_text doesn't exist within the within_text string, or start_num is greater than the length of within_text

Solution:

1. Verify the search text exists in your data 2. Check for extra spaces using TRIM 3. Ensure start_num is valid 4. Use IFERROR to handle missing text: =IFERROR(SEARCH(text, cell), "Not Found")

Prevention:

Always validate your data and use IFERROR wrapper for production formulas

Frequency: 45%

Example:

#NAME?

Excel doesn't recognize the function name

Cause:

Misspelled function name, missing quotes around text, or using SEARCH in a version that doesn't support it

Solution:

1. Check spelling - it's SEARCH not SEACH or SERACH 2. Ensure text strings are in quotes 3. Verify Excel version compatibility

Prevention:

Use Formula AutoComplete and always put literal text in quotes

Frequency: 20%

Example:

#REF!

Invalid cell reference in formula

Cause:

Referenced cells have been deleted or the formula refers to cells that don't exist

Solution:

1. Check all cell references are valid 2. Re-select the cells if needed 3. Use named ranges for stability

Prevention:

Use structured references or named ranges instead of direct cell references

Frequency: 10%

Example:

Wrong Position Returned

SEARCH returns unexpected position number

Cause:

Not accounting for SEARCH being case-insensitive, or forgetting that position counting starts at 1, not 0

Solution:

1. Remember SEARCH is case-insensitive (use FIND for case-sensitive) 2. Position 1 means first character 3. Check if there are multiple occurrences

Prevention:

Test with simple examples first and verify position counting

Frequency: 15%

Example:

Best Practices and Advanced Tips

Use ISNUMBER(SEARCH(...)) to get TRUE/FALSE instead of position/error. Perfect for IF statements and conditional formatting: =IF(ISNUMBER(SEARCH("urgent", A1)), "High Priority", "Normal").

To find the second or third occurrence, use nested SEARCH with start_num: =SEARCH("a", A1, SEARCH("a", A1) + 1) finds the second 'a'. Build a recursive pattern for multiple finds.

To search for literal * or ? characters, escape them with tilde (~). Search for '?' using '~?', for '*' using '~*', and for '~' itself using '~~'.

SEARCH can slow down with thousands of rows. For better performance: limit search range, use helper columns for complex searches, and consider array formulas for bulk operations.

SEARCH: case-insensitive, supports wildcards, returns #VALUE! if not found. FIND: case-sensitive, no wildcards, also returns #VALUE!. Choose SEARCH for flexible user input, FIND for exact matching.

SEARCH vs Alternative Functions
Platform Compatibility

Need Help with SEARCH Function in Excel?

Stop struggling with formula syntax. Use AskFormulas to generate validated formulas instantly with our AI-powered tool.

Example Excel formula:

Related Formulas

FIND Function in Excel

Master the FIND function to locate text within strings. Learn syntax, handle #VALUE! errors, and explore 7 practical examples for text extraction.

intermediate
text
ExcelExcel
Validated
LEFT Function in Excel

Extract text from the beginning of strings with the LEFT function. Learn syntax, examples, and error solutions for Excel and Google Sheets.

beginner
text
ExcelExcel
Validated
MID Function

Master the MID function to extract text from any position. Learn syntax, examples, and solutions to common errors for precise text manipulation.

beginner
text
ExcelExcel
Validated
SUBSTITUTE Function

Master the SUBSTITUTE function to replace text in Excel and Google Sheets. Learn syntax, examples, error handling, and advanced text techniques.

intermediate
text
ExcelExcel
Validated