如何计数当前条纹? [英] How to count current streak?
问题描述
我有一个1和0的列表,范围从 A1:A74 ,我正在找出目前的1条是什么。
例如我有:
1
0
1
1
1
我想要条纹给我3.
我已经尝试了以下公式,似乎为更小的范围工作,但对于我的全套,它给我错误的金额:
= COUNTA(A1:A73)-MATCH(1 ,INDEX(1 /(A1:A73 = 0),0))
任何帮助将不胜感激。 b
$ b
编辑 - 我相信我已经修复了上面的公式:
= COUNTA(S $ 2 :S $ 74)-MATCH(2,1 /(S2:S $ 74 = 0),1)
位置为0,并从具有值的总行数中减去此值。
如上所述,我已经弄清楚通过简单地简单地回答我自己的问题我需要做,变得非常明显:
= COUNTA(S $ 2:S $ 74)-MATCH(2,1 /(S2: S $ 74 = 0),1)
这基本上是找到最后一个位置0,并从总数中删除值。
I have a list of 1s and 0s in excel ranging from A1:A74 and I am looking to work out what the current streak of 1's is.
For example I have:
1 0 1 1 1
I would want the streak to give me 3.
I have tried the following formula which seems to work for smaller ranges, but for my full set it gives me the wrong amount:
=COUNTA(A1:A73)-MATCH(1,INDEX(1/(A1:A73=0),0))
Any help would be much appreciated.
edit - I believe i've fixed the formula above to work:
=COUNTA(S$2:S$74)-MATCH(2, 1/(S2:S$74=0), 1)
This is basically finding the last position of 0 and minusing this from the overall number of rows which have values.
As Above, I've figured out the answer to my own question by just simplifying exactly what I needed to do and it became very obvious:
=COUNTA(S$2:S$74)-MATCH(2, 1/(S2:S$74=0), 1)
This is basically finding the last position of 0 and minusing this from the overall number of rows which have values.
这篇关于如何计数当前条纹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!