View Single Post
  #4   Report Post  
Harlan Grove
 
Posts: n/a
Default

Peter Gundrum wrote...
Does anybody know if there is a way to do this. Say I
have a list of words

Car
Apple
Fan
House
Fork

Say I have a text string in one cell such as <B"My car is
in the house in my garage"</B.

....
What I need is some sort of function or formula that will
look at my list of words and tell me which words on the
list are in the text string and then mark the cell with
what words it found.

In this example in my text string are the words "House"
and "Car", so I would want the formula to put into the
cell an "H" telling me it found the word "House" and
a "C" telling me it found the word "Car"

So the final result in my cell where the formula is would
be "HC".

....

Aladin's solution involving MOREFUNC.XLL is best if you can use such an
add-in. If not, and if you don't have too many words in your list, you
could use something like

=LEFT(A1,--(COUNTIF(A8,"*"&A1&"*")0))
&LEFT(A2,--(COUNTIF(A8,"*"&A2&"*")0))
&LEFT(A3,--(COUNTIF(A8,"*"&A3&"*")0))
&LEFT(A4,--(COUNTIF(A8,"*"&A4&"*")0))
&LEFT(A5,--(COUNTIF(A8,"*"&A5&"*")0))

where A8 is the cell containing your string, and A1:A5 holds your list
of words.