# Finding the hidden words in strings of letters

1. ## Finding the hidden words in strings of letters

Hi! Can someone help me?

I have a list of strings of letters (column A):

YDHEIHGKCEWEC
RIGJSTARSDSFDH
JDSUNDHXSUNFL
HFYEIDGSKQWK
CBVNZTMOONWRH
DASFRERTYBJHX
JDIFJGFFGDFFPG
LKJHMOONDFJHU

And then a list of words (column B):
SUN
MOON
STAR

The words from the second list are hidden in the strings in the first list (I marked them red). The words can be hidden or more than once in the whole list, or even in the same string.

I need a formula in column C which will go through the whole list of words B, and for each of the words, return: how many times the word is hidden in the whole list, and in which string(s).

Any ideas?

Thanks!!

2. ## Re: Finding the hidden words in strings of letters

There is simple solution for words and different words within on word.

But it doesn't count same words within one word.

3. ## Re: Finding the hidden words in strings of letters

Hmm thanks... but maybe someone knows how to register the double appearances too?

4. ## Re: Finding the hidden words in strings of letters

Expanding on Zbor's idea, you could use:

=COUNTIF(A:A,"*"&B1&"*")+COUNTIF(A:A,"*"&B1&"*"&B1&"*")

to include where a word appears twice in a line, or using the same theory:

=COUNTIF(A:A,"*"&B1&"*")+COUNTIF(A:A,"*"&B1&"*"&B1&"*")+COUNTIF(A:A,"*"&B1&"*"&B1&"*"&B1&"*")

to count up to three appearances per line. And so on and so forth, until the formula gets too big for Excel.

I guess it depends on the length of your strings as to if this will be enough, or if you'll require something more complex?

5. ## Re: Finding the hidden words in strings of letters

Hi,

an attempt: in C3 waht you are looking to count

=(SUMPRODUCT(--LEN(\$A\$3:\$A\$1000))-SUMPRODUCT(--LEN(SUBSTITUTE(\$A\$3:\$A\$1000,C3,""))))/LEN(C3)

Hope it helps

6. ## Re: Finding the hidden words in strings of letters

Hi All,

I've dried up a little the SUMPRODUCT

=SUMPRODUCT(LEN(\$A\$3:\$A\$1000)-LEN(SUBSTITUTE(\$A\$3:\$A\$1000,C3,"")))/LEN(C3)

I'm sure there are better ways

Hope it helps

7. ## Re: Finding the hidden words in strings of letters

CANAPONE, your formula works perfectly. Thanks!!
Thanks to others too.

The only thing is, I said I also wanted the formula to show in which string(s) the word(s) are. That can also be a new formula, apart from this one.
To make it easier, we could add a column with marks S1, S2, S3 to numerize each string, and then the formula should return, "S3,S5" if the words are hidden in strings S3 and S5.

8. ## Re: Finding the hidden words in strings of letters

Hi,

the following formula could be an example to visually get the positions of "SUN" "MOON".

=IF(ISERROR(SMALL(IF(ISNUMBER(FIND(\$C3,\$A\$3:\$A\$12,1)),ROW(\$A\$3:\$A\$12)),COLUMN(A1))),"","A"&SMALL(IF(ISNUMBER(FIND(\$C3,\$A\$3:\$A\$12,1)),ROW(\$A\$3:\$A\$12)),COLUMN(A1)))
All the yellow formulae are array formule and hav to be confirmed with control+shift+enter.

Even If a string contains "SUN" twice or more, the formula gives back its position once.

Maybe the attachment is more clear.

Regards

9. ## Re: Finding the hidden words in strings of letters

It works... But I actually really need it with marks such as "S1, S2", not cell references
Is there any way to fix the same formula so that it returns these marks?

I hope you understand me, I mean this:

S1 JGDFJGASGD
S2 KJHSKJHKLK
S3 LKHJMOONQQ

MOON 1 S3

10. ## Re: Finding the hidden words in strings of letters

Hi, an attempt to get S1 S5 ...

=IF(ISERROR(SMALL(IF(ISNUMBER(FIND(\$C3,\$A\$3:\$A\$12,1)),ROW(\$A\$3:\$A\$12)),COLUMN(A1))),"","S"&SMALL(IF( ISNUMBER(FIND(\$C3,\$A\$3:\$A\$12,1)),ROW(\$A\$3:\$A\$12)),COLUMN(A1))-2)

Regards

11. ## Re: Finding the hidden words in strings of letters

The attempt works

Thanks a lot!!

12. ## Re: Finding the hidden words in strings of letters

Hi, thanks for the feedback.

If you'd need, you could substitute FIND -it's case sensitive, if I remember well- with SEARCH to work with a less touchy formula.

Regards

13. ## Re: Finding the hidden words in strings of letters

It doesn't matter in my case.. Thanks!

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1