Try:
=IF(MOD(A17,1)=0,SUMPRODUCT((INT($C$3:$C$8)=A17)*$I$3:$I$8),SUMPRODUCT(($C$3:$C$8=A17)*$I$3:$I$8))