+2  A: 

I would suggest using SUM() with an arrays:

  =SUM(C5:G11*(IF(COLUMN(C5:G11)<=($C$2+1),1,0)*IF($c$1=b5:b11,1,0)))

Enter that with Ctrl-Shift-Enter so it goes in as an array formula.

YMMV, but it worked with a quick test over here.

Basically, you're multiplying three arrays together: one with your data, one with a 1 or 0 based on the month match by column, the last with a 1 or 0 based on the status filter. The arrays don't match in size, so they are repeated.

richardtallent
I was thinking of something along the same lines, but your answer was already here:=SUM(MMULT((b5:b11=c1)*1,(COLUMN(c4:g4)-COLUMN(c4)<c2)*1)*c5:g11)The MMULT will return a 2-D array with a logical and of the conditions, and then you just multiply that by the array of numbers you want to conditionally sum.
jtolle
Nice. That works well, thanks for the help! :)
Nick Haslam
A: 
Robert Mearns