SEARCH Function

Returns the position of one text value inside another. Not case-sensitive, wildcards allowed.

Category

Text

Available in

All versions, Microsoft 365

Returns

A number (position)

Taught hands-on in Level 4: Advanced Dynamic Arrays & Logic - Advanced Math & Text module

Overview

SEARCH works like FIND but ignores case and understands wildcards: ? for any one character and * for any run of characters.

Its most common job is a “contains” test: ISNUMBER(SEARCH("refund", A2)) is TRUE when the word appears anywhere.

Syntax

=SEARCH(find_text, within_text, [start_num])

Arguments

ArgumentRequired?What it does
find_textYesWhat to look for. Use ? and * as wildcards; put ~ before a real ? or *.
within_textYesThe text to search.
start_numOptionalThe position to start from. Default 1.

Examples

Example 1 — Flagging refund requests

Mark every support ticket that mentions a refund, whatever the capitals.

B2fx=ISNUMBER(SEARCH("refund", A2))
AB
1TicketRefund?
2Please REFUND my orderTRUE
3Where is my parcel?FALSE
4Refund request #882TRUE
=ISNUMBER(SEARCH("refund", A2)) Explain

Example 2 — Wildcard positions

Find where a code like Q1, Q2, Q3 or Q4 starts.

=SEARCH("Q?", A2) Explain

Common mistakes

  • #VALUE! when nothing is found. That's why the contains test wraps SEARCH in ISNUMBER.

Notes

Kyle Stott

Author

Kyle Stott

Certified Microsoft Excel Expert

Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.