Please forget my previous post.
Use the following array formula instead:
=INDEX(D2

13,MATCH(1,((A2:A13>=DATE(YEAR(E2),MONT H(E2),1))*(B2:B13<=DATE(YEAR(E2),MONTH(E2)+1,0))), 0))
(Must be entered by holding down Ctrl and Shift before pressing Enter).
(Anyone who knows how to avoid the Big Grin icon when one enters for example D2 colon D13?)