SEARCH
Returns the 1-based position of one text string inside another.
SEARCH is case-insensitive and supports * and ? wildcards.
The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.
Syntax
=SEARCH(find_text, within_text, [start_num])
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
find_text | any | Required | — |
within_text | any | Required | — |
start_num | any | Optional | — |
Remarks
- Search is case-insensitive.
*matches any sequence and?matches a single character.start_numis 1-based and must be greater than0.
Error cases
- If no match is found, returns
#VALUE!.
Examples
Find a substring without matching letter case.
Formula =SEARCH("BO","Ana and bo")
Expected result 9
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Start at the second position and find the later occurrence.
Formula =SEARCH("A","A-B-a",2)
Expected result 5
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
A one-character text has its match at the first position.
Formula =SEARCH("A","A")
Expected result 1
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
The requested letters do not occur together in the source.
Formula =SEARCH("Cy","Ana and bo")
Expected result #VALUE!
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Case-insensitive search
Formula =SEARCH("world", "Hello World")
Expected result 7
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Wildcard pattern
Formula =SEARCH("d?ta*", "Meta Data Lake")
Expected result 6
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Related functions
FAQ
How are case and wildcards handled?
SEARCH is case-insensitive and supports * for any sequence plus ? for one character.