In E7, plop:
=IFERROR(INDEX($A$4:$A$56,MATCH(0,COUNTIF($E$6:E6, $A$4:$A$56),0)),"")
Which is an array formula confirmed with Ctrl+Shift+Enter instead of just hitting Enter as normal to exit the cell. Drag this down as far as needed, it will create your list.
In F7, plop:
=SUMPRODUCT(($B$4:$B$56>=F$6)*($B$4:$B$56<EOMONTH(F$6,0))*($A$4:$A$56=$E7))
And copy as far over and down as needed. This will count each unique value per month in the range.
Bookmarks