Consecutive wins in a row in certain conditions

clairecatx

New Member
Joined
Aug 9, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello. I'm trying to work out how to count max consecutive wins in a row under a range of conditions. For example, what is the max consecutive wins in a row in period 1 (Year 2020 to 2021) vs period 2 (Year 2022 to 2023)?

I'm using M365 and am aware of the =max(scan(...)) function, but this doesn't filter out wins that don't meet the condition specified. Tried using =maxif(max(scan(...)).criteria range 1, criteria) but no luck.

Does anyone have any advice on how to approach this?

1723219139045.png
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Hi & welcome to MrExcel.
How about
Fluff.xlsm
ABCDE
1
21W14
31W23
41W
51W
61L
71L
81L
91L
101W
111W
122L
132L
142L
152L
162W
172W
182L
192W
202W
212W
Data
Cell Formulas
RangeFormula
E2:E3E2=MAX(FREQUENCY(IF(($B$2:$B$21=D2)*($C$2:$C$21="W"),ROW($C$2:$C$21)),IF(($B$2:$B$21=D2)*($C$2:$C$21<>"W"),ROW($C$2:$C$21))))
 
Upvote 0
Another option:

Book12.xlsx
ABCDE
1YearPeriodW/L
220201W14
320201W23
420201W
520201W
620201L
720211L
820211L
920211L
1020211W
1120211W
1220222L
1320222L
1420222L
1520222L
1620222W
1720232W
1820232L
1920232W
2020232W
2120232W
Sheet5
Cell Formulas
RangeFormula
E2:E3E2=MAX(DROP(REDUCE(0, ($C$2:$C$21="W")*($B$2:$B$21=D2), LAMBDA(arr,new, VSTACK(arr, IF(new, TAKE(arr, -1) + 1, 0)))), 1))
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,221,503
Messages
6,160,195
Members
451,630
Latest member
zxhathust

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