Can I search a Text String For Numbers?

I have some cells with a string of numbers entered like this: 1,4,7

So they’d be text.

And I have an IF() function that I want to change its performance according to the numbers it finds in those strings, if any.

Is that a big hassle?

See the HELP for the SEARCH function - based on your description of the problem it will serve the purpose.

If this answer helped you, please accept it by clicking the check mark :heavy_check_mark: to the left and, karma permitting, upvote it. That will help other people with the same question.

In case you need clarification, edit your question (not an answer) or comment the relevant answer.

Hello,

to find the values in your string you may use:

find 1: =REGEX(A1;"\b1\b")
find 4: =REGEX(A1;"\b4\b")
find 7: =REGEX(A1;"\b7\b")

(assuming A1 contains the test string 1,4,7).

Note(s)

  • Word boundary \b is required to force exact matches.
  • If there is no match you’ll get a #N/A, so you may need to check using function ISERROR()
  • Results are text strings not numbers, so you may need to convert to numbers using function VALUE()

Hope that helps.

If the answer helped to solve your problem, please click the check mark (:heavy_check_mark:) next to the answer.

If there is no match you’ll get a #N/A, so you may need to check using function ISERROR()

Or rather ISNA() because ISERROR() catches any error.