if you have the first day of the month in D11:O11 then format that cell to just display months.
Use this formula for D12 and drag it across.
Formula: copy to clipboard
=COUNTIFS($D$2:$O$9,">"&D11,$D$2:$O$9,"<"&EOMONTH(D11,0))