Count number of times an event occurs between recurring events

Napoleoncarrot

New Member
Joined
Apr 20, 2018
Messages
4
I am trying to count how many times an event (over pressure) occurs between a recurring event (start), I have >10000 entries. My column looks like,

start
over pressure
over pressure
start
over pressure
start
over pressure
over pressure
start
start
start
over pressure
start

In some instances no over pressure is detected
Ideally I'd like the output to read for this example to read
0
1
2
0
1
0
1
2
0
0
0
1
0
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Welcome to the board.

Maybe:

AB
1EventCount
2start0
3over pressure1
4over pressure2
5start0
6over pressure1
7start0
8over pressure1
9over pressure2
10start0
11start0
12start0
13over pressure1
14start0

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet8

Worksheet Formulas
CellFormula
B2=IF(A2="start",0,SUM(B1,1))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0
If I could piggy back off of Eric Above, I did it using a manually typed 0 in B2, with this formula in B3 and below (dragged down):

Code:
=IF(A3="over pressure", B2+1,0)

Edit: also... fun fact: turns out I was also working off of my Sheet8 xD
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,924
Messages
6,122,294
Members
449,077
Latest member
Rkmenon

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