title: Countif with time interval
body: <p>My Google Sheets:</p>
  
  <pre><code>name   paid   time
  john    y     2015/08/02 14:14
  john    n     2015/08/02 14:13
  john    n     2015/08/02 14:12
  pat     n     2015/08/02 14:11
  peter   n     2015/08/02 14:10
  greg    n     2015/08/02 14:09
  ricardo n     2015/08/02 14:05
  barack  y     2015/08/02 14:02
  john    n     2015/08/02 20:14
  </code></pre>
  
  <p>I need to count people who don't pay or don't pay within 10 minutes (if the person doesn't pay during 10 minutes so he hasn't paid). I tried with :</p>
  
  <pre><code>=SUMPRODUCT(--(A2:A9&lt;&gt;"")/COUNTIF(A2:A9,A2:A9&amp;""))-COUNTIF(B2:B9,"y")
  </code></pre>
  
  <p>which is a good start but I don't have the time interval as parameter.</p>
  
  <p>In this case <strong>it returns <code>4</code> but not <code>5</code> as I wish</strong> because <code>John</code> paid in an interval 10 minutes (between 14:12 and 14:14) but not at 20:14.</p>
  
  <p>For instance, it starts at 2015/08/02 14:12 for John (the first NO -> n) then let's see what happen in the next 10 minutes. </p>
  
  <p>If nothing, so we consider he didn't pay.
  Else "y", so he paid</p>
  
  <p>And we continue anyway later to see what happen for john    n     2015/08/02 20:14 (he didn't pay because nothing after 20:14)</p>
  
  <p>So <strong>total of 5 guys</strong> and not 4.</p>