I have around 1500 rows such as shown below. I want to sum the 1s that appear consecutively in this row.
0 0 1 1 0 1 1 1 1 0 1 0 1 0 1 1 0
As can be seen, the value 1 appears consecutively 2 times then 4 times and then finally 2 times. So, the output should be 2+4+2=8
I have came close the solution by using. Now, the only part left is conditional sum on this frequency formula array where the value is greater than 1.Formula:![]()
Please Login or Register to view this content.
Simple sum on this frequency array i.e.gives me 10 as it takes into accout the two non-consecutive 1s in the row as well.Formula:![]()
Please Login or Register to view this content.
Thanks.
Bookmarks