Try

=IF(AND(D$1+0>=YEAR($B2),D$1+0<=YEAR($C2)),$A2/(YEAR($C2)-YEAR($B2)+1),0)

Headers in TABLES are always TEXT so you cannot compare with a Excel date; the D$1+0 converts the header text to a numeric value