Phrase counter

dorkus

New Member
Joined
Aug 19, 2008
Messages
5
Hi All,

I would like to be able to count the frequency of specified phrases in the substrings of cells in a column.

1591187370958.png


Requirement
In the above example, we would paste values into column A and then based on a list of phrases in column C the frequency of those phrases would be listed in column E.
(As a futher level of sophistication, is it possible to to count "Fox Jumped" and "foxes jump" as the same value (so in the example above the frequecy of "fox jump" would display a frequency of 2? )

Statement list
Statements
The quick brown fox jumped over the happy dog
Is a wagging tail a sign of a happy dog?
The customer did not follow the correct process
My colleague did not follow the correct process
the advice on the website does not show the correct process
Parent is unhappy with level of home work
Parents will be invited to the play
Foxes jump over thehappy dog


Phrase List
happy dog
correct process
home work
fox jump

Many thanks in advance
 

Attachments

  • 1591187040634.png
    1591187040634.png
    43.8 KB · Views: 5

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
In E2 and fill down, one of

=SUM(COUNTIF(A:A,{"","","* ","* "}&C2*{""," *"," *",""}))

=COUNTIF(A:A"*"&SUBSTITUTE(C2," ","*")&"*")

The first will only count exact matches, so jump and jumped will not be counted as the same.

I haven't tested the second formula, if it does work, in addition to your examples it will also count Foxes watch happy dogs jumping
It will not be possible to exclude this and count the similarities that you asked for.
 
Last edited:
Upvote 0
In E2 and fill down, one of

=SUM(COUNTIF(A:A,{"","","* ","* "}&C2*{""," *"," *",""}))

=COUNTIF(A:A"*"&SUBSTITUTE(C2," ","*")&"*")

The first will only count exact matches, so jump and jumped will not be counted as the same.

I haven't tested the second formula, if it does work, in addition to your examples it will also count Foxes watch happy dogs jumping
It will not be possible to exclude this and count the similarities that you asked for.
The first line didn't work but after adding a comma to your second line the result is exactly what I was looking for. Thank you so much!
 
Upvote 0

Forum statistics

Threads
1,214,924
Messages
6,122,294
Members
449,077
Latest member
Rkmenon

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top