If cell part contains a word from a list
Solved
Coco
-
Coco -
Coco -
Hello to all Excel enthusiasts, this magical tool,
I have an existential question that I've been stuck on for a few hours, without finding a satisfactory answer on the Internet.
Let me explain:
In cell B1, I have a long text. I want to know if this text contains any of the words listed in the range D1:D10.
For example, if B1 contains "Hello, my name is Coco, I came to discuss my problem with excel"
and in D1:D10 I have "move", "belt", "translate", "basket", "narrow", "bludgeon", "problem", "verb", ...
This should return TRUE;
whereas if in D1:D10 I have "move", "belt", "translate", "basket", "narrow", "bludgeon", "razor", "verb", ...
This should return FALSE
Another requirement: the formula should be placed in C1, so that it can be copied down to check the condition for B2, B3, ...
How do I do that?
Is that clear?
I have an existential question that I've been stuck on for a few hours, without finding a satisfactory answer on the Internet.
Let me explain:
In cell B1, I have a long text. I want to know if this text contains any of the words listed in the range D1:D10.
For example, if B1 contains "Hello, my name is Coco, I came to discuss my problem with excel"
and in D1:D10 I have "move", "belt", "translate", "basket", "narrow", "bludgeon", "problem", "verb", ...
This should return TRUE;
whereas if in D1:D10 I have "move", "belt", "translate", "basket", "narrow", "bludgeon", "razor", "verb", ...
This should return FALSE
Another requirement: the formula should be placed in C1, so that it can be copied down to check the condition for B2, B3, ...
How do I do that?
Is that clear?
2 answers
-
Hello
One possibility:
In E1, enter the formula:
=COUNTIF($B$1,"*"&D1&"*")
and drag it down to E10
When the word exists, the formula returns 1 (or 2 if the word is present twice), 0 otherwise
Best regards
Via
--
"Imagination is more important than knowledge." A. Einstein-
-
-
Thank you Vaucluse, it seems to be working pretty well. Ideally, it should be transferable to multiple files and intended for use by people who may not necessarily know how to create functions, so even if it works perfectly, it's still not the perfect gem I was hoping for :/
In any case, thank you very much for taking the time, and it will probably be useful for future VBA projects anyway :D
-
-
Re,
friendly greeting Vaucluse ☺,
Or with a custom function
https://mon-partage.fr/f/LdxrkXKY/
Cheers
Via
--
"Imagination is more important than knowledge." A. Einstein