This is an equivalent formula, I just did a small change, but I think it makes more sense like this:
=SUMPRODUCT(LOOKUP(((ROW(1:12)<MONTH(T1))+(ROW(1:12)=MONTH(T1))*(((DAY(T1)>=DAY(A1))+(DAY(T1+1)=1))>0))*((YEAR(T1)-YEAR(A1))*12-MONTH(A1)+ROW(1:12)),{-12,0;24,3;60,7;84,10;180,20}))
=SUMPRODUCT(LOOKUP(((ROW(1:12)<MONTH(T1))+(ROW(1:12)=MONTH(T1))*(((DAY(T1)>=DAY(A1))+(DAY(T1+1)=1))>0))*((YEAR(T1)-YEAR(A1))*12-MONTH(A1)+ROW(1:12)),{-12,0;24,3;60,7;84,10;180,20}))