title: Excel Formula COUNTIFS and counting non-blank cells
body: <p>I know this has been answered before, but I have tried the formulas suggested.</p>
  
  <p>I am trying to count rows only if the first column has specific text (at least partial text) and the second column is NOT blank.</p>
  
  <p>Here is my formula:</p>
  
  <pre><code>=SUM(SUMIF(A2:A33,"BA*",B2:B33)/SUM((COUNTIFS(A2:A33,"BA*",B2:B33,"&lt;&gt;"))*2))
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/pZkwb.jpg" alt="screenshot"></p>
  
  <p>My problem is that the rows where Column B is blank are still getting counted.</p>
  
  <p>I have tried:</p>
  
  <pre><code>=SUM(SUMIF(A2:A33,"BA*",B2:B33)/SUM((COUNTIFS(A2:A33,"BA*",B2:B33,"&lt;&gt;"&amp;""))*2))
  </code></pre>
  
  <p>Same results.</p>
  
  <p>Evaluation shows:</p>
  
  <pre><code>=SUM(8/SUM((COUNTIFS(A2:A33,"BA*",B2:B33,"&lt;&gt;"&amp;""))*2))
  THEN:
  =SUM(8/SUM((7)*2))
  THEN:
  =SUM(8/14)
  </code></pre>
  
  <p>Any ideas what I am doing wrong here?</p>