Excel formula: "IF" a cell contains a word, then?

Solved
Tonio5933 Posted messages 4 Status Membre -  
Mike-31 Posted messages 18404 Registration date   Status Contributeur Last intervention   -
Hello everyone,

I've been struggling for several days and haven't found any answers on the forums.

Here's the problem:
In column A, I have text (for example, LAST NAME FIRST NAME)
I would like to put a formula in column B that gives me a result based on part of the text in A.
Example: if A1 contains "Fabien" or "Franck" or other names (about 10 possibilities), then it returns "student", otherwise, nothing.

Am I clear enough for someone to help me?

Thanks in advance for any tips

Configuration: Windows / Firefox 54.0

5 answers

Mike-31 Posted messages 18404 Registration date   Status Contributor Last intervention   5 140
 
Good evening,

One formula among others

=IF(OR(COUNTIF(A2,"*franck*"),COUNTIF(A2,"*michel*"),COUNTIF(A2,"*fabien*")),"student","") 


It's up to you to add COUNTIF(A2,"*franck*") without forgetting the asterisks
Cheers
Mike-31

I am responsible for what I say, not for what you understand...
47
Tonio5933 Posted messages 4 Status Member
 
Thank you Mike!
I just tested it, and it seems to work.
I'm finishing my formula with everything I need and I'll get back to you if I run into any issues again!

Thanks again
0
Mike-31 Posted messages 18404 Registration date   Status Contributor Last intervention   5 140 > Tonio5933 Posted messages 4 Status Member
 
Re,

Okay no problem, anyway if your issue is resolved don't forget to mark the discussion as resolved.
Best regards
1
Bryan
 
Hello,

I need to get a formula:

If in my column A the answer is "NO", then give in column C the value written in a cell in column B.

Thank you all
0
Dilou-31
 
Hello,
I had a similar case. It works perfectly. Thank you very much!
Best regards
0