title: How to count cells until a value is greater than 0?
body: <p>In Excel I am trying to count the number of days until an appointment is available. </p>
  
  <p>in the below data set I need to be able to count until a value is reached that is not 0. </p>
  
  <p>the result I need is</p>
  
  <ul>
  <li>Example 1 = 3 </li>
  <li>Example 2 = 5 </li>
  <li>Example 3 = 0</li>
  </ul>
  
  <p>In plain English I need it to check if cell = 0 if it is then count it, and stop counting when cell is no longer = 0  </p>
  
  <p>If there is a VBA solution that would be best but ill accept anything that works. </p>
  
  <pre>            Example1    Example2   Example3
  May 13 2019    0           0          2
  May 14 2019    0           0          0
  May 15 2019    0           0          6
  May 16 2019    6           0          0
  May 17 2019    0           0          3
  May 20 2019    3           7          0
  May 21 2019    6           14         0
  May 22 2019    6           0          1
  May 23 2019    12          14         0
  May 24 2019    7           0          0</pre>
  
  <p>I have tried multiple methods however the closest i got was with the below VBA which seems to give the right answer before crashing my excel so I suspect its counting something it shouldn't. </p>
  
  <pre><code>    Dim iCntr As Integer
      iCntr = 2
      Do While (Cells(iCntr, 3).Value) = 0
      Range("C13").Value = Application.WorksheetFunction.Count("C:C")
      Loop
  End Sub
  </code></pre>