title: In Excel, How do I count the number of blank cells until the next non-blank cell
body: <p>I have a spreadsheet which resembles the below. Column A is my data and Column B is what I am trying to achieve</p>
  
  <pre><code>         A           B
     +-----------+-----------+
  1  | Some text |   A1:A3   |
     +-----------+-----------+
  2  |           |           |
     +-----------+-----------+
  3  |           |           |
     +-----------+-----------+
  4  | Some text |   A4:A8   |
     +-----------+-----------+
  5  |           |           |
     +-----------+-----------+
  6  |           |           |
     +-----------+-----------+
  7  |           |           |
     +-----------+-----------+
  8  |           |           |
     +-----------+-----------+
  9  | Some text |   A9:A9   |
     +-----------+-----------+
  10 | Some text |  A10:A10  |
     +-----------+-----------+
  11 |           |           |
     +-----------+-----------+
  12 |           |           |
     +-----------+-----------+
  </code></pre>
  
  <p>As you can see, Column A just contains empty and non-empty cells (all cells, including empty ones, actually contain a formula). In column B, I need to return a range starting at the current row and ending at the first non-empty row, but only if Column A of the current row is not blank. The returned result is to be used within another function. For example B1 could be COUNTBLANK(A1:A3), although the actual function is not COUNTBLANK, but a custom function</p>
  
  <p>Is this possible?</p>
  
  <p>Thanks</p>