Hi can anyone help with this code

=SUM(IF($D$22:$D$99="END DATE",IF(TEXT(E22:E99,"mmm yyyy")="APR"(),date),1,0))))

Having problems with the end part ie date.

The cell name is date with 2021 in so should read as arp 2021.