Counting consecutive occurrences

bmv505

New Member
Joined
Sep 28, 2022
Messages
20
Office Version
  1. 365
I have a spreadsheet with American football plays (the actual play by play data). I want to count the consecutive number of complete passes one specific player has. My spreadsheet has a column for play type, pass result, and QB (see image).

So in the specific example in the image, Penix completed three consecutive passes. Is there a formula that finds that out for me without me having to go through all the data and counting the consecutive completed passes?
 

Attachments

  • Excel example.PNG
    Excel example.PNG
    14.4 KB · Views: 12

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Book1
ABCDE
1PassCompleteMaximum consecutive
2Rush5
3PassComplete
4Rush
5Rush
6PassComplete
7PassComplete
8PassIncomplete
9PassComplete
10Rush
11PassComplete
12Rush
13PassComplete
14PassComplete
15PassComplete
16PassIncomplete
17Rush
18Rush
19PassComplete
20Rush
21PassComplete
22
Sheet1
Cell Formulas
RangeFormula
D2D2=MAX(SCAN(0,LET(a,B1:B21, FILTER(a,a<>"")),LAMBDA(s,c,IF(c="Complete",s+1,0))))
 
Upvote 0
=MAX(SCAN(0,LET(a,B1:B21, FILTER(a,a<>"")),LAMBDA(s,c,IF(c="Complete",s+1,0))))
Really appreciate you.

How would you do it if you want to do it by game? So QB completed 6 straight in game 1 and finished with a completion, but then completed 5 to start game 2. How can I calculate per game?
 

Attachments

  • Excel example1.PNG
    Excel example1.PNG
    32.6 KB · Views: 3
Upvote 0
Book1
ABCDEFG
1GameGameMaximum consecutive
21PassComplete14
31Rush24
41PassComplete31
51Rush
61Rush
71PassComplete
81PassComplete
91PassIncomplete
101PassComplete
112Rush
122PassComplete
132Rush
142PassComplete
152PassComplete
162PassComplete
173PassIncomplete
183Rush
193Rush
203PassComplete
213RushIncomplete
223PassComplete
23
Sheet1
Cell Formulas
RangeFormula
E2:E4E2=UNIQUE(A2:A22)
F2:F4F2=MAX(SCAN(0,LET(a,FILTER($A$2:$C$22, $A$2:$A$22=E2), b, INDEX(a,,3), FILTER(b,b<>"")),LAMBDA(s,c,IF(c="Complete",s+1,0))))
Dynamic array formulas.
 
Upvote 0
Could it be this that you are after?

24 01 01.xlsm
ABCDE
1GamePass ResultGameMax
21Incomplete16
31Complete25
41Complete30
51Complete
61Complete
71Complete
81Complete
91Incomplete
101Complete
112Complete
122Complete
132Complete
142Complete
152Complete
163Incomplete
173Incomplete
183Incomplete
Consecutive
Cell Formulas
RangeFormula
D2:D4D2=UNIQUE(A2:A18)
E2:E4E2=BYROW(D2#,LAMBDA(r,IFERROR(LEN(MAX(TEXTSPLIT(TRIM(CONCAT(IF(A$2:A$18=r,IF(B$2:B$18="Complete",1," "),"")))," ")+0)),0)))
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,215,073
Messages
6,122,976
Members
449,095
Latest member
Mr Hughes

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