Winning Streak

honkin

Active Member
Joined
Mar 20, 2012
Messages
385
Office Version
  1. 2016
Platform
  1. MacOS
I have a sheet which keeps records of football results. I'd like to be able to keep a tally of longest losing streak and longest losing streak.

Column K has the results, either WON or LOST, so I tried to use the SCAN function along with MAX to get the desired result

Here is the formula

Excel Formula:
=MAX(SCAN(0,K5:K100000,LAMBDA(a,v,IF(v="WON",a+1,0))))

It returns #NAME? instead of the desired number

Any thoughts as to what I have done wrong here? I tried inputting it as a normal formula initially, then even tried it as an array formula, but still no result

cheers
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
I also found another formula online which purports to calculate longest streak, but have had no result with this either

Here is the array formula

Excel Formula:
=SORTN(FREQUENCY(IF((K5:K="WON")*LEN(K5:K), ROW(K5:K)),IF((K5:K="WON")*LEN(K5:K), , ROW(K5:K))), 1, 0, 1, 0)

Any help gladly accepted

cheers
 
Upvote 0
Hello,

Ad 1) The formula will work only with Excel 365 (you seem to indicate 2016) + what language localization are you using?

Ad 2) It probably should be:

Excel Formula:
=MAX(FREQUENCY(IF((A1:A20="WON")*LEN(A1:A20),ROW(A1:A20)),IF((A1:A20="WON")*LEN(A1:A20),,ROW(A1:A20))))
 
Upvote 0
Or not LEN()

Excel Formula:
=MAX(FREQUENCY(IF((A1:A20="WON"),ROW(A1:A20)),IF((A1:A20<>"WON"),ROW(A1:A20))))
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,159
Members
453,021
Latest member
Justyna P

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