title: Excel: Optimizing a bunch of very heavy SUMIFS
body: <p>I have some data that I want summed matching certain criteria</p>
  
  <p>Example data:</p>
  
  <pre><code>  A    B   C   D
    Id   Id2 Id3 Val
    1    1   8   6
    1    2   7   7
    1    3   3   8
    1    4   6   4
    1    4   78  7
    1    1   2   9
    1    3   1   4
    1    4   3   6
    1    1   5   8
    1    4   7   2
  </code></pre>
  
  <p>Now I want the <strong>Val</strong> summed for every Id, based on certain criteria (e.g. Id2=4 and Id3=2) for every <strong>Id</strong> which has 100 values, but I want to avoid rerunning the sumifs for every <strong>Id</strong> since the table is heavy.</p>
  
  <p>What I have been doing so far is to </p>
  
  <pre><code>= SUMIFS(D:D, A:A, "=1", B:B, "=4", C:C, "=2")
  = SUMIFS(D:D, A:A, "=2", B:B, "=4", C:C, "=2")
  = SUMIFS(D:D, A:A, "=3", B:B, "=4", C:C, "=2")
  = SUMIFS(D:D, A:A, "=4", B:B, "=4", C:C, "=2") ... 
  </code></pre>
  
  <p>(if I remember the syntax of sumifs correctly)</p>
  
  <p>Is there a faster way that avoids rerunning the sumifs for each <strong>Id</strong> ?</p>