Question: What formula tells you if A1containsthe text “apple”?

This is a surprisingly tricky problem in Excel.

But FIND has an annoying quirk if itdoesn’tfind “apple”, it returns the #VALUE error.

Finding text with the FIND function

Unfortunately, this error appears even if we wrap the FIND function in the IF function.

Nobody likes to see errors in their spreadsheets.

(There may be some good reason for this, but returning zero would be much nicer.)

Finding text with the FIND function

What about theSEARCH function, which also locates the position of text?

Unlike FIND, SEARCH supports wildcards, and is not case-sensitive.

Maybe SEARCH returns FALSE or zero if the text isn’t found?Nope.

Finding text with the FIND function

SEARCH also returns #VALUE when the text isn’t found.

So, what to do?

For many situations (e.g.

Finding text with the FIND function

conditional formatting) a 1 or 0 result will be just fine.

Other examples

So what can you do with these kind of formulas?

Here are a few examples (with full explanations) to inspire you:

Logical confusion?

Finding text with the FIND function

If you should probably brush up on how logical formulas work,see this video.

It’s kind of boring, but it runs through a lot of examples.

Other formulas

If you like formulas (who doesn’t?!

Finding text with the FIND function with IF function

),we maintain a big list of examples.

Trapping the #VALUE error with the ISNUMBER function

Finding text with COUNTIF and wildcards

Finding text with COUNTIF plus IF

Finding text with the FIND function

Finding text with the FIND function with IF function

Trapping the #VALUE error with the ISNUMBER function

Finding text with COUNTIF and wildcards

Finding text with COUNTIF plus IF