Hi nejjoan14,
If column A does not have dates filled in, you would use something like:
=SUMPRODUCT((LOOKUP(ROW($A$5:$A$46), ROW($A$5:$A$46)/($A$5:$A$46<>0), $A$5:$A$46)>=$B$3)*(LOOKUP(ROW($A$5:$A$46), ROW($A$5:$A$46)/($A$5:$A$46<>0), $A$5:$A$46)<=$C$3)*($D$5:$D$46=$A49)*($H$5:$H$46))*24
If...