title: Sum multiple COUNTIF statements in a single formula
body: <p>I am working with an attendance sheet, and I am trying to calculate how many people showed up for 4 or more events in a given month.</p>
  
  <p>I am trying to write a formula that needs to count, for each row, whether there are 4 or more “x”s between a given range of columns. </p>
  
  <p>I believe the logic is as follows: If the count of “x” is >= 4, then assign it a value of 1 otherwise assigned it a 0. Loop through each row and then add all those values.</p>
  
  <p>So I can obviously write the first part,</p>
  
  <pre><code>=IF(COUNTIF(B:E, “x”)&gt;=4, 1, 0)
  </code></pre>
  
  <p><strong>Question 1</strong> How do I sum all those values for, say, rows 1 to 10?</p>
  
  <p><strong>Solution</strong>: <code>=SUM(1*(((B1:B10="x") +(C1:C10="x")+(D1:D10="x")+(E1:E10="x"))&gt;=4))</code> Thank you, CRondao.</p>
  
  <p><strong>Follow-up:</strong> Similarly, with the same attendance sheet, I need to calculate whether a particular person attended either of the two sessions on Friday (Session 1 is Column J and Sessions 2 is column K) and either of the two sessions on Saturday (Sessions 1 is Column L and Session 2 is Column M). I have a formula written that assigns a value of 1 if the person attends at least 1 session on both Friday and Saturday:</p>
  
  <pre><code>=IF(SUM(IF(COUNTIF(B1:C1, "x")&gt;=1, 1, 0)+IF(COUNTIF(D1:E1, "x")&gt;=1, 1, 0))=2, 1, 0)
  </code></pre>
  
  <p><strong>Question 2:</strong> How do I sum all those values for, say, rows 1 to 10?</p>