Count the number of instances of a word since another word

comonand

New Member
Joined
Feb 7, 2022
Messages
14
Office Version
  1. 365
Platform
  1. Windows
I'm not sure what function to use for this, i have a table like below, i would like to count the number of occurences of the word "Charge" since the word "Break in" for cell number 69. Feels like xlookup and countif but not sure. Help please!

batteries.xlsx
ABC
1Cell NoDateAction
26803/04/2024Break in
36903/04/2024Break in
46909/04/2024In Use
54009/04/2024In Use
64727/04/2024In Use
76527/04/2024In Use
86927/04/2024Charge
96917/05/2024In Use
105117/05/2024In Use
115717/05/2024In Use
126917/05/2024Charge
13918/05/2024Charge
14818/05/2024Charge
15123/05/2024In Use
161023/05/2024In Use
174723/05/2024Charge
186523/05/2024Charge
Sheet6
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
You can use COUNTIFS to count multiple criteria.
Book1
ABCDE
1Cell NoDateAction
2683/4/2024Break in1
3693/4/2024Break in
4699/4/2024In Use
5409/4/2024In Use
64727/4/2024In Use
76527/4/2024In Use
86927/4/2024Charge
96917/5/2024In Use
105117/5/2024In Use
115717/5/2024In Use
126917/5/2024Charge
13918/5/2024Charge
14818/5/2024Charge
15123/5/2024In Use
161023/5/2024In Use
174723/5/2024Charge
186523/5/2024Charge
Sheet6
Cell Formulas
RangeFormula
E2E2=COUNTIFS(C2:C18,"Break in",A2:A18,69)
 
Upvote 0
Thanks for the reply, i want to count the number of times "charge" appears after "break in".

So the list is longer than that, thats just a section, so it will find the last occurrence of "break in" then use that cell to the end of the table to create a range and use a countif to count the number.
 
Upvote 0
Are there multiple instances of "Break in"?
Are all "Charges" always occur after "Break in"?
 
Upvote 0
Are there multiple instances of "Break in"?
Are all "Charges" always occur after "Break in"?
Yes multiple instances of "break in" I only want the last one

No "charge" could appear before the last break in, I only want to count the ones after.
 
Upvote 0
Give this a try:
Book2
ABCDEF
1Cell NoDateActionCell69
26845385Break in4
36945385Break in
46945391In Use
54045391In Use
64745409In Use
76545409In Use
86945409Charge
96945429In Use
105145429In Use
115745429In Use
126945429Break in
13945430Charge
14845430Charge
15145435In Use
161045435In Use
174745435Charge
186545435Charge
196945429Charge
206945429Charge
216945429Charge
226945429Charge
Sheet2
Cell Formulas
RangeFormula
F2F2=LET(f,FILTER(C2:C22,A2:A22=F1),x,XMATCH("Break In",f,,-1),SUM(--(DROP(f,x)="Charge")))
 
Upvote 0
Solution

Forum statistics

Threads
1,224,819
Messages
6,181,153
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