Named ranges:
current_month =INDEX(Sheet1!$A:$A,current_month_row):INDEX(Sheet1!$C:$C,MATCH(9000000000,Sheet1!$C:$C))
current_month_row =Sheet1!$T$1
Previous_Month =Sheet1!$A$2:INDEX(Sheet1!$C:$C,current_month_row-1)
D2:
=IFERROR(CHOOSE(((RIGHT(A2,2)*1)=MONTH(TODAY()))+1,
INDEX(current_month,MATCH(B2,INDEX(current_month,0,2),0),3),
INDEX(Previous_Month,MATCH(B2,INDEX(Previous_Month,0,2),0),3)),"Deleted")
find start of current month (T1):
=MIN(IF(A2:INDEX(A:A,COUNTA(A:A))<>A2,ROW(A2:INDEX(A:A,COUNTA(A:A)))))
Bookmarks