The issue is that you cannot perform array comparisons like that in VBA.

I would suggest you redo the calculations using Evaluate:

wc.Cells(2, 4) = ws.Evaluate("SumProduct(--(Month(AN2:AN" & lastRow & ")=2)")
for example