title: Google Sheets counting with multiple criteria
body: <p>I have a Google Sheet where I have several columns of data, and I want to get a count of how many rows match two criteria, where one of the criteria is matching either one of two values.</p>
  
  <p>Here’s an example of the data I have:</p>
  
  <p><a href="https://i.stack.imgur.com/jjq1w.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jjq1w.png" alt="enter image description here"></a></p>
  
  <p>What I want to do is things like: get a count of how many rows have “Yes” in column A, and either “A” or “C” in column B.  Or how many rows are “No” and either “I” or “X”.</p>
  
  <p>I’ve come up with this:</p>
  
  <p><code>=COUNTIFS($A1:$A21,"Yes",B1:B21,"="&amp;"A")+COUNTIFS($A1:$A21,"Yes",B1:B21,"="&amp;"C")
  </code></p>
  
  <p>…but that feels clunky, and makes it harder to update if I decide to shift columns around.  Not to mention really bad if I want to combine multiple bits of information into a single cell, such as this:</p>
  
  <p><code>=(COUNTIFS($A1:$A21,"Yes",B1:B21,"="&amp;"A")+COUNTIFS($A1:$A21,"Yes",B1:B21,"="&amp;"C")) &amp; "/" &amp; (COUNTIFS($A1:$A21,"No",B1:B21,"="&amp;"A")+COUNTIFS($A1:$A21,"No",B1:B21,"="&amp;"C"))
  </code></p>
  
  <p>I mean, that’s just awful.  It works, but it’s awful.</p>
  
  <p>I’ve tried using <code>OR()</code> without success, and also tried curly-bracket syntax without success.  I fully acknowledge I may have done both of them wrong, but if so, darned if I can figure out what I missed.  Any Sheets mavens willing to take pity on an old dude and show me a much smarter way to do this?</p>