How to Use SEARCH Function in Excel: Simple Guide
The
SEARCH function in Excel finds the position of one text string inside another, returning the number where the text starts. It is case-insensitive and can be used to locate words or characters within a cell. Use =SEARCH(find_text, within_text, [start_num]) to apply it.Syntax
The SEARCH function has three parts:
- find_text: The text you want to find.
- within_text: The text or cell where you want to search.
- start_num (optional): The position to start searching from (default is 1).
The function returns the position number where find_text first appears in within_text. If not found, it returns an error.
excel
=SEARCH(find_text, within_text, [start_num])
Example
This example shows how to find the position of the word "apple" in a sentence.
excel
=SEARCH("apple", "I like apple pie")
Output
8
Common Pitfalls
Common mistakes include:
- Using
SEARCHwith case sensitivity (it is case-insensitive, so useFINDif case matters). - Not handling errors when the text is not found, which causes
#VALUE!error. - Forgetting the optional
start_numwhen you want to search after a certain position.
To avoid errors, wrap SEARCH in IFERROR like this:
excel
=IFERROR(SEARCH("apple", A1), "Not found")
Quick Reference
| Parameter | Description |
|---|---|
| find_text | Text you want to find |
| within_text | Text or cell to search in |
| start_num | Optional start position for search (default 1) |
Key Takeaways
SEARCH finds the position of text inside another text, ignoring case.
Use the optional start_num to begin searching from a specific position.
Wrap SEARCH in IFERROR to handle cases when text is not found.
SEARCH is case-insensitive; use FIND for case-sensitive search.
SEARCH returns the position number where the text starts.