Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 90299

calculate current consecutive streak ignoring blanks

$
0
0

I have a daily log with four different value types. Positive, Negative, Zero, or Blank.

I am interested in the consecutive Zeroes, where Positive and Negative values end the streak, and Blanks are ignored.

Each record is on 1 row and contains a name and values

Example:

Day  1  2 3 4 5 6 7 8 
Fred 1 -2 0 _ 0 0 0 0  calculate current streak of 5
Jane 0 -5 _ 0 0 _ _ _  calculate current streak of 2
John 4 -6 3 0 0 0 3 0  calculate current streak of 1
Amie 2  0 0 0 0 0 0 -3 current streak 0

I can use COUNTIF to get the total zeroes, but not the streak

From this similar question, calculate consecute streak in excel row

I've tried variations of =IFERROR(MATCH(TRUE,INDEX(B2:I2<>0,0),0)-1,COUNT(B2:I2))

I'm getting wonky results, and my supervisor wants me to be done with this already. Any help or ideas would be greatly appreciated!


Viewing all articles
Browse latest Browse all 90299

Trending Articles



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