# How to calculate weighted average of hourly sales in a day

I have hourly sales data & want to aggregate it to a day level. Out of 24 hours, we are classifying 6 hrs as peak hours and 18 hrs as non-peak.

Assume peak hr sales for a day as: $$X_1,X_2,\ldots,X_6$$

Non-peak hr sales for a day as: $$Y_1,Y_2,\ldots,Y_{18}$$

How can we take a weighted average of peak hr and non-peak hrs to get the data to a day level?

Ideal case would be to use the units sold in each hour as weights. But i don't have that information. What i have instead is a supply-demand information. Out of which, the trend of hourly demand follows the trend of the hourly price.

1. Use demand as weights and calculate weighted average (but demand is not equal to actual units sold)

2. Use $$\frac{\frac{1}{4}\sum_{i=1}^{6}X_{i} + \frac{3}{4}\sum_{i=1}^{18}Y_{i}}{15}$$ where $$15 = \frac{1}{4}*6 + \frac{3}{4}*18$$

Which would be more accurate? Or is there a better way?

Just weight the respective means by $$\frac{1}{4}$$ and $$\frac{3}{4}$$, respectively.
$$\overline{\text{Sales}} = \frac{1}{4} \sum_{i=1}^6 X_i + \frac{3}{4} \sum_{i=1}^{18} Y_i$$