I have a specific formula that counts the dates by month/year (B718). I have 9 total as you can see below.... In another column I have time spent on those dates. I need to find the average time over those dates with time spent. I actually have the formula working but the total dates e.g. 9 was my divider... So, if the column with time spent had empty/blank cells my average would calculate incorrectly since the total dates didn't match the total cells with time spent... As you can see the picture below shows the two columns (dates) and (spent hours)... there is blank cells. Here is the formula that works if there is no blank cells.... My column B is hidden, but column C shows the dates

=SUMIF(B:B,B718,H:H)/COUNTIF(B:B,B718)

I was thinking of using sumproduct or countblank and minus the sum from the number of dates found, this number would be the revised number to divide my total hours to find the average...