title: Statistics of Variable Range Using Criteria
body: <p>I need help to calculate min, max, average using data criteria. The image below shows two columns of data namely time and speed. I want to calculate the average speed for the range from time 0 (cell 2) to cell 14. Then, calculate the average speed from the next 0 (cell 15) to cell 20, and so forth. Obviously, the same formula can be applied to calculate min, max, and other statistics. </p>
  
  <p>Is there a way to write a smart formula that knows how to average each segment separately? The image below illustrates three segments, but my original dataset is much bigger: <a href="https://i.stack.imgur.com/jAajS.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jAajS.jpg" alt="enter image description here"></a></p>