Counting the Number of times text appears by criteria

William53

New Member
Joined
Jul 8, 2017
Messages
40
Office Version
  1. 365
Platform
  1. Windows
Hi All
My issue is this:
I have a large data set which unfortunately I cannot show which has multiple columns. I want to find certain text in a column of data (the cells can contain anything from 5 -20 words) but only count that text when the adjacent cell contains another word. I have found a lot of articles/formulas (sumproduct etc) that will count the number of times it appears but also counts the adjacent cell as well so instead of getting 10 as the answer it is giving me 20. An example is below.
OvertoppingWater from Pad 2 has overtopped the basin and needs emptying
Water Excess water has been captured in the rainwater pit at Pad 2
OvertoppingWater from the basin at Pad 2 has overtopped

What I need the formula to do is count the number of times Pad 2 occurs when the adjacent cell says Overtopping, so in this case it would be 2

Many thanks for any assistance

William
 
Try.
活頁簿1
ABCD
1OvertoppingWater from Pad 2 has overtopped the basin and needs emptyingCount
2WaterExcess water has been captured in the rainwater pit at Pad 22
3OvertoppingWater from the basin at Pad 2 has overtopped
Sheet1
Cell Formulas
RangeFormula
D2D2=SUM((A1:A3="Overtopping")*(ISNUMBER(FIND("Pad 2",B1:B3))))
 
Upvote 0
Try.
活頁簿1
ABCD
1OvertoppingWater from Pad 2 has overtopped the basin and needs emptyingCount
2WaterExcess water has been captured in the rainwater pit at Pad 22
3OvertoppingWater from the basin at Pad 2 has overtopped
Sheet1
Cell Formulas
RangeFormula
D2D2=SUM((A1:A3="Overtopping")*(ISNUMBER(FIND("Pad 2",B1:B3))))
Thank you so much HongRu, works perfectly.
 
Upvote 0
COUNTIFS is designed exactly for this sort of task.

25 03 22.xlsm
ABCD
1OvertoppingWater from Pad 2 has overtopped the basin and needs emptyingCount
2WaterExcess water has been captured in the rainwater pit at Pad 22
3OvertoppingWater from the basin at Pad 2 has overtopped
COUNTIFS
Cell Formulas
RangeFormula
D2D2=COUNTIFS(A1:A3,"Overtopping",B1:B3,"*Pad 2*")
 
Upvote 0

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