Calculate win streak

jbifeelgood

New Member
Joined
Jan 9, 2020
Messages
2
Office Version
  1. 2019
Platform
  1. MacOS
Hi,

I have table tennis match data for 3 people;
Person (1) D3:R3
Person (2) D4:R4
Person (3) D5:R5

Where the values are 2 (win) 1 (draw) and 0 (loss). I would like to calculate the longest win and loss streak for each.

This is also then repeated in D9:R9, D15:R19, D20:R20 (person a), D10:R10, D16:R16, D21:R21 (person b), D11:R11, D17:R17. D22:R2, not sure if it would be possible to include all of these ranges for each person as well?
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Welcome to the Board!

Try:

Book1
ABCDEFGHIJKLMNOPQR
1Longest win streakLongest loss streak
221
332Andy212220112121120
461Serena222222012221221
522Roger112101221221200
Sheet4
Cell Formulas
RangeFormula
A3:B5A3{=MAX(FREQUENCY(IF($D3:$R3=A$2,COLUMN($D3:$R3)),IF($D3:$R3<>A$2,COLUMN($D3:$R3))))}
Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces.


I'm not sure what you mean when you say the ranges are repeated later. Do you mean that the range for person A should be D3:R3 and then continues in D9:R9, so that a 2 in R3 and a 2 in D9 is a streak of 2?
 
Upvote 0
Welcome to the Board!

Try:

Book1
ABCDEFGHIJKLMNOPQR
1Longest win streakLongest loss streak
221
332Andy212220112121120
461Serena222222012221221
522Roger112101221221200
Sheet4
Cell Formulas
RangeFormula
A3:B5A3{=MAX(FREQUENCY(IF($D3:$R3=A$2,COLUMN($D3:$R3)),IF($D3:$R3<>A$2,COLUMN($D3:$R3))))}
Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces.


I'm not sure what you mean when you say the ranges are repeated later. Do you mean that the range for person A should be D3:R3 and then continues in D9:R9, so that a 2 in R3 and a 2 in D9 is a streak of 2?


That's amazing, thank you! The ranges repeated later are a bit more complex... what you've given will do the job nicely. Thank you for your time and help!
 
Upvote 0

Forum statistics

Threads
1,214,883
Messages
6,122,077
Members
449,064
Latest member
MattDRT

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