Function · Text
Excel SEARCH function
The Excel SEARCH function finds text and ignores case. The letters tx start at character 9 of Austin, TX 78701.
Syntax =SEARCH(find_text, within_text, [start_num])
=SEARCH("tx","Austin, TX 78701")Arguments
| Name | Required | What to pass |
|---|---|---|
| find_text | Required | The text to look for. Case is ignored. * and ? are wildcards. A tilde before them searches for the character itself. |
| within_text | Required | The text to search. |
| start_num | Optional | Where to start. The default is 1. |
Examples
Find the state abbreviation regardless of case
=SEARCH("tx",B1)Result 9
| A | B | |
|---|---|---|
| 1 | Address | Austin, TX 78701 |
| 2 | Position of tx | 9 |
SEARCH is FIND without the case check, and with wildcards. tx matches TX in Austin, TX 78701. The match starts at character 9: six letters of Austin, the comma, the space, then T. FIND with the lowercase letters would have returned #VALUE! on this cell.
Use SEARCH when people type state codes in either case. Use FIND when case is part of the data, such as a product code where a12 and A12 are different. Both functions return a position, not the matched text. MID, starting at that position, pulls the characters out.