If you replace 1 with Row(A1) you can drag it down to change months

=sumproduct(--(Month(rangewithdates)=Row(A1)),rangewith$)
VBA Noob