Formula to create consecutive wins/losses

James8761

Board Regular
Joined
Apr 24, 2012
Messages
154
Office Version
  1. 2019
Platform
  1. Windows
Hi All,

I'm working on trying to produce some stats for a football league I help run. As the results come in I just put a W or a L against the team name to show if they won or lost. The data is in columns F2:G1255. An example is show below.

I want to create a formula that shows the most amount of consecutive losses "L" a team has had. The answer I would want for Baystown in the example shown would be 4.

Then I need to create a formula for the most amount of consecutive Wins "W" a team has had. The answer I would want for Globe in the example shown would be 3.

Does anyone know if the above formulas are possible please?

Kind regards,
James

BaystownL
GlobeW
North ShieldsL
EastbridgeW
BaystownL
BaystownL
North ShieldsW
EastbridgeW
GlobeW
GlobeW
North ShieldsL
BaystownL
BaystownW
GlobeL
GlobeW
North ShieldsW
EastbridgeL
EastbridgeW

<colgroup><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Try


F
G
H
I
J
K
1
Team​
Result​
Team​
L or W?​
Formula​
2
Baystown​
L​
Baystown​
L​
4​
3
Globe​
W​
Globe​
W​
3​
4
North Shields​
L​
5
Eastbridge​
W​
6
Baystown​
L​
7
Baystown​
L​
8
North Shields​
W​
9
Eastbridge​
W​
10
Globe​
W​
11
Globe​
W​
12
North Shields​
L​
13
Baystown​
L​
14
Baystown​
W​
15
Globe​
L​
16
Globe​
W​
17
North Shields​
W​
18
Eastbridge​
L​
19
Eastbridge​
W​
20

Criteria in columns I:J

Array formula in K2 copied down
=MAX(FREQUENCY(IF(F$2:F$1255=I2,IF(G$2:G$1255=J2,ROW(G$2:G$1255)-ROW(G$2)+1)),IF(F$2:F$1255=I2,IF(G$2:G$1255<>J2,ROW(G$2:G$1255)-ROW(G$2)+1))))
confirmed with Ctrl+Shift+Enter, not just Enter

Hope this helps

M.
 
Upvote 0
Thanks so much for this, Marcelo. It's great, does exactly what I want.
 
Upvote 0

Forum statistics

Threads
1,215,650
Messages
6,126,019
Members
449,280
Latest member
Miahr

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