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

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
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
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,598
Members
449,089
Latest member
Motoracer88

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