Text function

SEARCH function

Returns the position of one text inside another, ignoring case and allowing wildcards (* and ?).

Available in All versions of Excel, including Microsoft 365, Excel for Mac and Excel for the web

In every Excel versionWorks in Google Sheets

Syntax

SEARCH(find_text, within_text, [start_num])
ArgumentWhat it means
find_textRequiredThe text to look for. May contain ? (any one character) and * (any characters); put ~ before them to search for the literal character.
within_textRequiredThe text or cell to search in.
start_numOptionalCharacter position to start from. Default 1.

Returns: A number: the position of the first character of the match.

How SEARCH works

SEARCH works like FIND - it returns the position where some text starts - but it is more forgiving: it ignores upper and lower case and understands wildcards. =SEARCH("sale","Summer SALE 2026") returns 8 even though the cell says SALE in capitals.

The most common use is not the position itself but the test "does this cell contain...?": ISNUMBER(SEARCH("refund",A2)) is TRUE when the word appears anywhere, in any case. That pattern powers keyword categorisation of support tickets, bank transactions or product names, often inside IF or FILTER.

Wildcards: ? stands for any single character and * for any number of characters, so "b?g" matches bag, big and BUG. To look for an actual question mark or asterisk, put a tilde in front: "~?". When nothing is found SEARCH returns #VALUE!.

Examples

1Position ignoring case

B2fx=SEARCH("sale",A2)
AB
1Campaign
2Summer SALE 20268

Result: 8

sale matches SALE, which starts at character 8. FIND would return an error here.

2Categorise support tickets

B2fx=IF(ISNUMBER(SEARCH("refund",A2)),"Refund","Other")
AB
1Ticket
2Customer asks for a REFUNDRefund

Result: Refund

SEARCH returns a number (21), so ISNUMBER is TRUE and the ticket is tagged. If the word were missing, SEARCH's error would make ISNUMBER FALSE.

3Wildcard: any one character

B2fx=SEARCH("b?g",A2)
AB
1Item
2Large Bag, red7

Result: 7

b?g matches Bag (any letter in the middle, any case), which starts at position 7.

4Find a real question mark

B2fx=SEARCH("~?",A2)
AB
1Note
2Ready? Go6

Result: 6

The tilde makes ? literal instead of a wildcard. The question mark is the 6th character.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 17 KB

Common errors and how to fix them

ErrorWhy it happensFix
#VALUE!The text was not found, or start_num is less than 1 or larger than the text length.Wrap in IFERROR or use ISNUMBER(SEARCH(...)) for a TRUE/FALSE result.

Tips

  • Searching for several keywords at once: =SUM(--ISNUMBER(SEARCH({"refund","return"},A2)))>0.
  • Short keywords match inside longer words: SEARCH("art","Smart TV") finds a match. Add spaces around the word or use REGEXTEST with \b word boundaries for whole words.
  • COUNTIF with wildcards ("*refund*") counts matching cells directly without SEARCH.

Questions

How do I check if a cell contains a word?

=ISNUMBER(SEARCH("word",A2)) returns TRUE if the word appears anywhere, ignoring case.

Is SEARCH case-sensitive?

No. Use FIND when upper and lower case must match exactly.

How do I search for an asterisk or question mark?

Put a tilde in front of it: SEARCH("~*",A2) finds a literal asterisk.

Google Sheets

SEARCH also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.

SEARCH in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
CzechHLEDAT
DanishSØG
DutchVIND.SPEC
FinnishKÄY.LÄPI
FrenchCHERCHE
GermanSUCHEN
HungarianSZÖVEG.KERES
ItalianRICERCA
Norwegian (Bokmål)SØK
PolishSZUKAJ.TEKST
Portuguese (Brazil)LOCALIZAR
Portuguese (Portugal)PROCURAR
RussianПОИСК
SpanishHALLAR
SwedishSÖK
TurkishMBUL

Recipes that use SEARCH