ElyxAI
formulas

How to Use SEARCH Function

Excel 2016Excel 2019Excel 365Excel Online

Learn to use the SEARCH function to locate text within a cell and return its position. This function is case-insensitive and essential for text parsing, validation, and conditional formulas. You'll discover how to find substring positions, build dynamic formulas, and handle errors gracefully for professional data analysis.

Why This Matters

SEARCH enables precise text location and extraction without manual searching, critical for data cleaning, validation, and building intelligent formulas that adapt to changing content.

Prerequisites

  • Basic understanding of Excel cell references and formulas
  • Familiarity with text-based data and string concepts

Step-by-Step Instructions

1

Open a new spreadsheet with sample data

Launch Excel and create a test dataset with product names or text entries in column A (e.g., 'Product-123', 'Invoice#ABC456').

2

Click the target cell for the formula

Select cell B1 where you want the SEARCH result to appear (the position of found text).

3

Enter the SEARCH formula syntax

Type: =SEARCH("text_to_find", A1) to find the position of 'text_to_find' within cell A1; the function returns the character position number.

4

Press Enter and review the result

Hit Enter to execute the formula; Excel returns the starting position number (e.g., 5 if 'text' starts at the 5th character).

5

Copy the formula down for multiple rows

Select B1 and drag the fill handle down to apply SEARCH to all rows in your dataset.

Alternative Methods

Use FIND for case-sensitive searches

Replace SEARCH with FIND() if you need exact case matching; both functions return position but FIND distinguishes uppercase from lowercase.

Combine with MID or RIGHT for extraction

Use SEARCH inside MID() or RIGHT() to extract text dynamically based on position without hardcoding values.

Tips & Tricks

  • SEARCH is case-insensitive, so 'ABC' and 'abc' are treated identically.
  • Use IFERROR(SEARCH(...), "") to hide error messages when text isn't found.
  • Wildcards like ? (single char) and * (multiple chars) are supported in SEARCH.

Pro Tips

  • Nest SEARCH with MID to extract substring: =MID(A1, SEARCH("#", A1)+1, 3) extracts 3 characters after a # symbol.
  • Use SEARCH to validate data format before processing with conditional logic.
  • Combine with COUNTIF to find how many cells contain a specific substring pattern.

Troubleshooting

Formula returns #VALUE! error

The search text doesn't exist in the cell. Wrap the SEARCH formula in IFERROR: =IFERROR(SEARCH("text", A1), "Not found") to handle missing values gracefully.

SEARCH not finding partial matches with wildcards

Ensure wildcard syntax is correct: * matches any sequence and ? matches single characters. Example: =SEARCH("Pro*", A1) finds 'Product' or 'Professional'.

Getting wrong position number

Remember SEARCH returns the starting position from the left; count manually or verify your reference cell contains the expected data.

Related Excel Formulas

Frequently Asked Questions

What's the difference between SEARCH and FIND?
SEARCH is case-insensitive and supports wildcards, while FIND is case-sensitive and doesn't support wildcards. Choose SEARCH for flexible text location and FIND for exact matching.
Can SEARCH return the actual text instead of position?
No, SEARCH only returns the starting character position. Combine it with MID() or other text functions to extract the actual substring you need.
How do I handle errors when text is not found?
Use IFERROR() or IFNA() wrapper: =IFERROR(SEARCH("text", A1), 0) returns 0 if text isn't found instead of #VALUE! error, allowing your formula to continue processing.

This was one task. ElyxAI handles hundreds.

Sign up