Find text inside a cell with FIND and SEARCH

Text and cleaning · About 5 minutes

Find text inside a cell with FIND and SEARCH

FIND tells you where some text starts inside a cell. =FIND("@",A2) reads as "at which character of A2 does the @ start?" For meena.r@zoho.in the answer is 8.

SEARCH does the same job, with two differences. It ignores capitals, so "upi" finds UPI. And it takes wildcards: ? stands for any one character and * for any run of characters.

If the text isn't there, both give a #VALUE! error. Wrap them in ISNUMBER to get TRUE when the text is found and FALSE when it isn't.

Part of Plus

Free during our founding launch: sign in to unlock this lesson's exercises, the timed practice sets and the rest of Plus. The free lessons stay free, with no account needed.

What FIND and SEARCH does

FIND and SEARCH tell you where a piece of text starts inside a cell, as a position number. The first character is 1, so in 1920x1080 the x is at position 5.

On their own they give a number, but that number is what lets LEFT and MID cut text at a dash, a space or an @ wherever it falls. Wrapped in ISNUMBER, they also answer whether a cell contains some text at all.

How to write FIND and SEARCH

=FIND(find_text, within_text, [start_num])

find_text
The text to look for, in quotes, like "-". Capitals matter.
within_text
The cell to look in, like A2.
start_num
The position to start looking from. The square brackets mean it's optional: leave it out and the search starts at the first character.

=SEARCH(find_text, within_text, [start_num])

find_text
The text to look for. Capitals don't matter, so "red" also finds Red.
within_text
The cell to look in.
start_num
Optional, the same as in FIND.

FIND and SEARCH worked example

Each screen size is written width x height. In B2, find the position of the x in A2, then fill down to B5.

Each screen size is written width x height. In B2, find the position of the x in A2, then fill down to B5.
AB
1Screenx at
21920x10805
31280x7205
4640x4804
53840x21605
B2=FIND("x",A2)Find where the x starts in A2: it is the 5th character, so the first row shows 5. Filled down, the column shows 5, 5, 4 and 5.

Common FIND and SEARCH mistakes

The result is #VALUE!

The text isn't in the cell, so there is no position to give. Check the spelling and, for FIND, the capitals, or wrap the formula in IFERROR to show something calmer.

FIND misses a word that is clearly there

FIND treats capitals as different letters, so "x" does not find X. Use SEARCH when capitals may vary.

SEARCH matches a question mark you meant literally

In Excel, SEARCH treats ? and * as wildcards. Put a tilde before the mark, like "~?", to look for the character itself, or use FIND, which has no wildcards.

FIND or SEARCH?

Use FIND when capitals matter or when you look for a symbol like a dash, @ or x. Use SEARCH when capitals may vary. In Excel, SEARCH also takes wildcards: ? for any one character and * for any run of characters. Both work in Excel and Google Sheets.

To check whether a cell contains some text, wrap either one in ISNUMBER, which gives TRUE when the text is found.

Questions people ask

What is the difference between FIND and SEARCH?

FIND matches capitals exactly and takes no wildcards. SEARCH ignores capitals and takes ? and *.

Why does FIND give #VALUE!?

The text isn't in the cell. Wrap it in ISNUMBER for TRUE or FALSE, or in IFERROR for a message.

How do I check if a cell contains some text?

=ISNUMBER(SEARCH("upi",A2)) is TRUE when A2 contains upi. If a cell contains text, return a value in Excel

Do FIND and SEARCH work in Google Sheets?

Yes, with the same parts in the same order.

Theme