I'm trying to use sumproduct to get data between 2 dates, date ranges are in a column.

=SUMPRODUCT(--(data!$D$2:$D$493>dates!A15),--(data!$D$2:$D$493<dates!A17),--(data!$C$2:$C$493))
I can't just have it =datesA16 because the time of day throws it off.

It's not giving me the correct data based on the dates.

Am I missing something?