Count each Value from a List of Values in a Column

Eric G

New Member
Joined
Dec 21, 2017
Messages
47
I have a list of passages in one column and a list of words or phrases in another column. Then I have a third column reserved for how many times each word or phrase appears in the column with the list of passages.

For example:

In column A (List of passages),
A1: The red fox jumped over the red fence.
A2: The blue chicken clucked at the red fox.
A3: The green frog hopped into the blue pond while the blue chicken was clucking at the red fox.

In column C (List of words or phrases),
C1: red
C2: blue
C3: green
C4: red fox
C5: green frog

In column D (Counts for each respective word or phrase),
D1: 4
D2: 2
D3: 1
D4: 3
D5: 1

What formula or VBA code could be used to determine the counts in column D?
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
How about
+Fluff v2.xlsm
ABCD
1
2The red fox jumped over the red fence.red4
3The blue chicken clucked at the red fox.blue3
4The green frog hopped into the blue pond while the blue chicken was clucking at the red fox.green1
5red fox3
6green frog1
7
Summary
Cell Formulas
RangeFormula
D2:D6D2=SUMPRODUCT(((LEN($A$2:$A$4)-LEN(SUBSTITUTE($A$2:$A$4,C2,"")))/LEN(C2)))
 
Upvote 0
Solution
The only problem with your solution, Fluff, is it shows that I don't know how to count. Looks like I missed a "blue" in my example question. As always, thank you. You're a master.
 
Upvote 0

Forum statistics

Threads
1,224,814
Messages
6,181,120
Members
453,021
Latest member
Justyna P

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