Category: FUNCTION | Updated: 2026-11-22

How to Use the SEARCH Function in Google Sheets | Case-Insensitive Text Position Lookup

How to Use the SEARCH Function

The SEARCH function returns the character position where a specified search string first appears in text. It searches without distinguishing between uppercase and lowercase letters and supports flexible wildcard pattern matching.

Syntax

=SEARCH(search_for, text_to_search, [starting_at])
  • search_for: The character or word whose position you want to find (required). Wildcards (* for zero or more characters, ? for any single character) are supported.
  • text_to_search: The text string or cell reference to search within (required).
  • starting_at: The character position from the start of the text at which to begin searching (optional). Defaults to 1 (the beginning).

Example Using a Table

Here is an example of finding the starting position of "abc" in product codes regardless of uppercase or lowercase letters.

Row Column A (Product Code) Column B (Start Position of “abc”)
1 Product Code Start Position
2 ITEM-abc-001 =SEARCH("abc", A2) → 6
3 PROD-ABC-999 =SEARCH("abc", A3) → 6
4 CODE-aBc-555 =SEARCH("abc", A4) → 6
  • Formula: =SEARCH("abc", A2)
  • Result: 6

Whether it appears as uppercase "ABC" or mixed-case "aBc", SEARCH matches them equally and returns position 6.

Common Errors and Notes

  • Returns #VALUE! If Not Found: If search_for does not exist in text_to_search, a #VALUE! error is returned. To test whether a keyword is present as TRUE or FALSE, use =ISNUMBER(SEARCH("abc", A2)).
  • Searching for Literal Wildcard Characters: To search for * or ? as literal characters, prefix them with a tilde (~), such as "~*" or "~?".
  • Out-of-Range starting_at Causes #VALUE!: Specifying 0 or less, or a number greater than the length of text_to_search, produces a #VALUE! error.

Frequently Asked Questions

Q. What is the difference between SEARCH and FIND?

A. SEARCH is case-insensitive and supports wildcard matching (* and ?), whereas FIND is strictly case-sensitive and does not support wildcards.

Q. How can I prevent errors when SEARCH does not find the target text?

A. Combine it with IFERROR. For example, "=IFERROR(SEARCH("abc", A2), 0)" returns 0 instead of an error when the target text is not present.