title: Excel Vba sumif function array
body: <p>I am wanting to transfer a worksheet formula i have in a spreadsheet,but cannot seem to find how to do it, I could write multiple sumifs but i need to do it for approx 11 types, so not the cleanest way. The issue comes down to the columns being summed and consecutive but obviously depending on the month could be just N or N,O or N,O,P,Q etc
  This is entered using CTRL+SHIFT+ENTER</p>
  
  <p>My formula in Excel is </p>
  
  <pre><code>Sum(if(Range=Criteria,if(range=&lt;criteria,Range)))
  
  =Sum(if(Data!$A$4:$A$1000=$A11,if(Data!$N$3:$Y$3&lt;=EOMONTH($A$1,-2)+1,Data$N$4:$Y$1000)))
  </code></pre>
  
  <p>Any ideas would be appreciated</p>