Count how many times a text group appears in a range

Osvaldo Palmeiro

Well-known Member
Joined
Feb 24, 2009
Messages
752
Office Version
  1. 365
Platform
  1. Windows
Please, I would like to have a formula to calculate how many times the group of words in D1: D3 appears, in that order, in the range A1: A20.
The formula should return 4.
Thanks in advance.

AD
catcat
dogdog
turtleturtle
aaa
kkk
cat
dog
turtle
xxx
cat
dog
turtle
cat
dog
turtle
aaa
dog
cat
xxx
turtle

<tbody>
</tbody>
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
A
B
C
D
E
F
G
1
catcat5=COUNTIF(A1:A20,D1)
2
dogdog5=COUNTIF(A2:A21,D2)
3
turtleturtle5=COUNTIF(A3:A22,D3)
4
aaa
5
kkk
6
cat
7
dog
8
turtle
9
xxx
10
cat
11
dog
12
turtle
13
cat
14
dog
15
turtle
16
aaa
17
dog
18
cat
19
xxx
20
turtle
 
Upvote 0
Hi, Logit. Thanks for reply, but I was hopping to a count for the group of texts located in D1: D3, and not individual counting for each text separately.

Hi, Steve. Thanks for the solution. It worked as expected.
As I've posted just a reduced sample, so the range in A could be A1: A150 and the searched range could be D1: D10, for example, would there be some other formula, maybe an array one, that could reference the ranges directly? Something like SUMPRODUCT (A1: A150, D1: D10).
Thanks any way.
 
Upvote 0

Forum statistics

Threads
1,215,480
Messages
6,125,050
Members
449,206
Latest member
Healthydogs

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