Find the Position of Text in a Cell

Excel Formulas › Text

All versionsSEARCH

Where does “@” appear, or the word “error”? SEARCH returns the character position of text within a cell — the building block for splitting, extracting, and testing.


Quick formula: position of “@” in A2:
=SEARCH("@", A2)
Returns the character number where “@” starts. SEARCH is case-insensitive; FIND is case-sensitive.

Functions used (tap for the full reference guide):

The example

The @ sits at position 4.

AB
1TextPosition of @
2ann@x.com4

The formula

The character index of the match:

=SEARCH("@", A2) // "ann@x.com" → 4

How it works

SEARCH locates text and returns its position:

  1. SEARCH(find, within) returns the starting position of find inside within.
  2. It’s case-insensitive and allows wildcards; FIND is case-sensitive and literal.
  3. A 3rd argument sets the start position — search from there to find a later occurrence.
  4. Use the position with LEFT/MID/RIGHT to split or extract around it; wrap with ISNUMBER to test “does it contain?”

“Contains” test: =ISNUMBER(SEARCH("error", A2)) returns TRUE/FALSE — SEARCH gives a number when found and an error when not, and ISNUMBER turns that into a clean yes/no.

Try it: interactive demo

Live demo

Find a substring’s position.

Position:

Variations

Case-sensitive

Use FIND:

=FIND("X", A2)

Contains?

Yes/no:

=ISNUMBER(SEARCH("error", A2))

Nth occurrence

Start past the first:

=SEARCH("a", A2, SEARCH("a",A2)+1)

Pitfalls & errors

Not found = error. SEARCH returns #VALUE! when the text isn’t there. Wrap with IFERROR, or use ISNUMBER for a test.

SEARCH vs FIND. SEARCH ignores case and allows wildcards; FIND is exact-case. Pick deliberately.

Position is 1-based. The first character is position 1, not 0.

Practice workbook

📊
Download the free Find the Position of Text in a Cell practice workbook
A text-position finder with the case-sensitive, contains, and Nth variants, plus 4 challenges with answers. No sign-up required.

Frequently asked questions

How do I find the position of text in a cell in Excel?
Use =SEARCH(find, within), e.g. =SEARCH("@", A2) returns where "@" starts. SEARCH is case-insensitive; FIND is case-sensitive.
How do I test whether a cell contains some text?
Wrap SEARCH in ISNUMBER: =ISNUMBER(SEARCH("error", A2)) returns TRUE/FALSE.
How do I find a later occurrence?
Pass a start position as the third argument: =SEARCH("a", A2, previousPosition+1).

Stop fighting formulas. Learn them in a day.

This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related formulas: Find Nth occurrence · Check if a cell contains text · Extract after a label

Function references: SEARCH · FIND