title: SUMIFS function in Google Spreadsheet
body: <p>I'm trying to have a similar function to <strong><em>SUMIFS</em></strong> (like <strong><em>SUMIF</em></strong> but with more than a single criterion) in a Google Spreadsheet. MS-Excel has this function built-in (<a href="http://office.microsoft.com/en-us/excel-help/sumifs-function-HA010342933.aspx?CTT=1" rel="noreferrer">http://office.microsoft.com/en-us/excel-help/sumifs-function-HA010342933.aspx?CTT=1</a>).</p>
  
  <p>I've tried to use ArrayFormula (<a href="http://support.google.com/docs/bin/answer.py?hl=en&amp;answer=71291" rel="noreferrer">http://support.google.com/docs/bin/answer.py?hl=en&amp;answer=71291</a>), similar to the SUMIF:</p>
  
  <pre><code>=ARRAYFORMULA(SUM(IF(A1:A10&gt;5, A1:A10, 0)))
  </code></pre>
  
  <p>By Adding <strong><em>AND</em></strong>:</p>
  
  <pre><code>=ARRAYFORMULA(SUM(IF(AND(A1:A10&gt;5,B1:B10=1), C1:C10, 0)))
  </code></pre>
  
  <p>But the <strong><em>AND</em></strong> function didn't pick up the <strong><em>ArrayFormula</em></strong> instruction and returned FALSE all the times.</p>
  
  <p>The only solution I could find was to use <strong><em>QUERY</em></strong> which seems a bit slow and complex:</p>
  
  <pre><code>=SUM(QUERY(A1:C10,"Select C where A&gt;5 AND B=1"))
  </code></pre>
  
  <p>My Target is to fill up a table (similar to a Pivot Table) with many values to calculate:</p>
  
  <pre><code>=SUM(QUERY(DataRange,Concatenate( "Select C where A=",$A2," AND B=",B$1)))
  </code></pre>
  
  <p>Did anyone manage to do it in a simpler and faster way?</p>