1

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)

2 Answers 2

0

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.

0

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

=COUNTIF(A1,"*Chris*")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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