Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9782

How to count a non-consecutive winning streak?

$
0
0

I'm trying to create a counter of the maximum daily "win streak" of a specific activity. However, in any given day it's perfectly reasonable to have not attempted the activity in question at all. Weekends in particular are the usual culprit. So I need to be able to count the largest "winning streak" that can have days which are skipped.

Data example:

DateWin
Mon, Sep 12FALSE
Tue, Sep 13TRUE
Wed, Sep 14FALSE
Thu, Sep 15TRUE
Fri, Sep 16TRUE
Sat, Sep 17-
Sun, Sep 18-
Mon, Sep 19TRUE

So in this example, the largest win streak is 3. Saturday and Sunday are ignored as nothing happened those days.

I currently am using a formula at this page and it works but does not ignore days without activity:

=sortn(frequency(if((Q2:Q>0)*len(Q2:Q),row(Q2:Q)),if((Q2:Q>0)*len(Q2:Q),,row(Q2:Q))),1,0,1,0)

How can I modify this formula to ignore "null" days, or use a different single-formula (no helper columns etc.) approach?


Viewing all articles
Browse latest Browse all 9782

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>