Tough Winning Streak Formula

Autonomous

New Member
Joined
Apr 30, 2019
Messages
5
This is my first post on MrExcel and I really need a hand... I have a multi team game log where the dates are out of order and the data doesn't contain who played who so each team must be handled independently. I'm trying to figure out win streaks and current streaks "for each" team (Should I be writing VBA instead?) but my arrays aren't working properly. Any help would be appreciated!

ABCDE
13 Teams DateResultMax Win StreakCurrent Streak
2Red1/20/2019Win
3Red1/21/2019Win
4Red4/20/2019Loss
5Blue1/10/2019Loss
6Blue1/2/2019Win
7Blue1/4/2019Win
8Blue1/9/2019Win
9Red3/20/2019Win
10Red1/6/2019Win
11Red1/7/2019Win
12Green1/15/2019Loss
13Red1/22/2019Win
14Green2/13/2019Win
15Blue1/3/2019Loss
16Green1/14/2019Loss

<tbody>
</tbody>
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Welcome to Mr Excel Forum

Maybe something like this

A
B
C
D
E
F
G
1
3 Teams​
Date​
Result​
Team​
Max Win Streak​
Current Streak​
2
Red​
01/20/2019​
Win​
Red​
6​
0​
3
Red​
01/21/2019​
Win​
Blue​
2​
0​
4
Red​
04/20/2019​
Loss​
Green​
1​
1​
5
Blue​
01/10/2019​
Loss​
6
Blue​
01/02/2019​
Win​
7
Blue​
01/04/2019​
Win​
8
Blue​
01/09/2019​
Win​
9
Red​
03/20/2019​
Win​
10
Red​
01/06/2019​
Win​
11
Red​
01/07/2019​
Win​
12
Green​
01/15/2019​
Loss​
13
Red​
01/22/2019​
Win​
14
Green​
02/13/2019​
Win​
15
Blue​
01/03/2019​
Loss​
16
Green​
01/14/2019​
Loss​
17

Array formula in F2 copied down
=MAX(FREQUENCY(IF($A$2:$A$16=E2,IF(C$2:C$16="Win",B$2:B$16)),IF($A$2:$A$16=E2,IF(C$2:C$16="Loss",B$2:B$16))))
confirmed with Ctrl+Shift+Enter, not just Enter

Array formula in G2 copied down
=LOOKUP(9.99E+307,FREQUENCY(IF($A$2:$A$16=E2,IF(C$2:C$16="Win",B$2:B$16)),IF($A$2:$A$16=E2,IF(C$2:C$16="Loss",B$2:B$16))))
confirmed with Ctrl+Shift+Enter, not just Enter

Hope this helps

M.
 
Upvote 0
Welcome to Mr Excel Forum

Maybe something like this

A
B
C
D
E
F
G
1
3 Teams​
Date​
Result​
Team​
Max Win Streak​
Current Streak​
2
Red​
01/20/2019​
Win​
Red​
6​
0​
3
Red​
01/21/2019​
Win​
Blue​
2​
0​
4
Red​
04/20/2019​
Loss​
Green​
1​
1​
5
Blue​
01/10/2019​
Loss​
6
Blue​
01/02/2019​
Win​
7
Blue​
01/04/2019​
Win​
8
Blue​
01/09/2019​
Win​
9
Red​
03/20/2019​
Win​
10
Red​
01/06/2019​
Win​
11
Red​
01/07/2019​
Win​
12
Green​
01/15/2019​
Loss​
13
Red​
01/22/2019​
Win​
14
Green​
02/13/2019​
Win​
15
Blue​
01/03/2019​
Loss​
16
Green​
01/14/2019​
Loss​
17

<tbody>
</tbody>


Array formula in F2 copied down
=MAX(FREQUENCY(IF($A$2:$A$16=E2,IF(C$2:C$16="Win",B$2:B$16)),IF($A$2:$A$16=E2,IF(C$2:C$16="Loss",B$2:B$16))))
confirmed with Ctrl+Shift+Enter, not just Enter

Array formula in G2 copied down
=LOOKUP(9.99E+307,FREQUENCY(IF($A$2:$A$16=E2,IF(C$2:C$16="Win",B$2:B$16)),IF($A$2:$A$16=E2,IF(C$2:C$16="Loss",B$2:B$16))))
confirmed with Ctrl+Shift+Enter, not just Enter

Hope this helps

M.


That did the trick! My problem was I forgot the $ symbols in my ranges thanks. I also converted everything to named ranges to make it tidy. Arrays can be pretty heavy with a larger data set any tips on better performance with arrays other than limiting the range to exact values and not the entire column?
 
Upvote 0
The most important thing is to limit the ranges - never use whole columns. But if the size of your data is huge the performance may not be good. Just testing to see ...

M.
 
Upvote 0

Forum statistics

Threads
1,214,975
Messages
6,122,538
Members
449,088
Latest member
RandomExceller01

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