title: Google Sheets - Calculate sum of row results - by using one-liner formula
body: <p>In some column have formula like below:</p>
  <pre><code>=SUM(MMULT(IFNA(FILTER($H$2:$H;$G$2:$G=M2);0);L2))
  </code></pre>
  <p>I have expanded it in 3 rows (A1:A3):</p>
  <pre><code>=SUM(MMULT(IFNA(FILTER($H$2:$H;$G$2:$G=M2);0);L2))
  =SUM(MMULT(IFNA(FILTER($H$2:$H;$G$2:$G=M3);0);L3))
  =SUM(MMULT(IFNA(FILTER($H$2:$H;$G$2:$G=M4);0);L4))
  </code></pre>
  <p>And I'm getting right results.
  Then I want to get sum of those. But I need to create all of above in one line.
  I mean - I don't want to calculate above separately and then do something like SUM(A1:A3).</p>
  <p>I was trying with ARRAYFORMULA() but with no success, yeah, how hard can it be, right?</p>
  <p>Have a nice evening!</p>
  <p><strong>UPDATE:</strong></p>
  <p>If someone will look for the solution, the best one is Mike's solution. Take a look at picture what he has added.</p>
  <p>I have just extended it to filter L and M columns and it does not matter how long columns are. Of course L and M columns have to have the same number of elements ;)</p>
  <pre><code>=SUM(MMULT(ARRAYFORMULA(--(G2:G=TRANSPOSE(FILTER(M2:M;ISTEXT(M2:M))))*(H2:H));FILTER(L2:L;ISNUMBER(L2:L))))
  </code></pre>