Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If I have a string to find in a cell such as:

[Agent Name & ID: Christopher Montaray - 1011]

… and I use the IF statement, can I search for a part of it? For example:

=IF (A1="Chris",1,0)
share|improve this question
up vote 0 down vote accepted

You need to use SEARCH or FIND, which will return the position of the start of the string you want to locate, or an error if the string is not present. e.g.

=SEARCH("Chris", A1)

You can then use IFERROR or another function like that to handle the error case.

share|improve this answer

You could also use COUNTIF function with a wildcard which will give you 1 or 0 directly

=COUNTIF(A1,"*Chris*")

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.