Hello leruma. Welcome to the forum.
I took a guess.
With random dates in sheet1 array enter this formula in Sheet2 cell B2. Fill down and across until you get blanks.
Formula:
=IFERROR(SMALL(IF(YEAR(INDEX(Sheet1!$B$2:$BT$6,MATCH($A2,Sheet1!$A$2:$A$6,0),))=$A$1,INDEX(Sheet1!$B$2:$BT$6,MATCH($A2,Sheet1!$A$2:$A$6,0),)),COLUMNS($B:B)),"")
See the attached.
Bookmarks