Re: frequency of a particular month in a range of date say d
=MAX((YEAR(B1)-1)-(YEAR(A1)+1),0)+(MONTH(A1)<=E1)+(MONTH(B1)>=E1)-(TEXT(A1,"m-yyyy")=TEXT(B1,"m-yyy"))
=MAX((YEAR(B1)-1)-(YEAR(A1)+1),0)
counts the diffference in whole year. The max function disallows negatives.
+(MONTH(A1)<=E1) adds 1 if the month in the first year date starts at or before the month designated in e1
+(MONTH(B1)>=E1) adds 1 if the month in the second date starts at or after the month designiated in e1
-(TEXT(A1,"m-yyyy")=TEXT(B1,"m-yyy")) subtracts 1 in the case where the the two dates are in the same month and year, to avoid the duplciate counting that would happen with the previous two section.