Hi All,
I input a range of data for each day of the year. I need to calculate the average output over the last 30 "production days" and just cannot get it right.
1) I can't take the usual average as some days are not production days, so I need to exclude those days from the calculation.
2) I need the average over the last 30 production days, so those non-production days should be ignored in the 30-day count
3) There are some days where production is also zero, but it's still a production day, so that day and the zero has to be included in the average.
Some examples below:
for 01/02/2022: Average is calculated for the date range 01/01/2022-01/02/2022, 32 days but two of those are non-production days. Average = (7+8)/30 = 0.5
I input a range of data for each day of the year. I need to calculate the average output over the last 30 "production days" and just cannot get it right.
1) I can't take the usual average as some days are not production days, so I need to exclude those days from the calculation.
2) I need the average over the last 30 production days, so those non-production days should be ignored in the 30-day count
3) There are some days where production is also zero, but it's still a production day, so that day and the zero has to be included in the average.
Some examples below:
Date (dd/mm/yyyy) | Production day? | Production |
01/01/2022 | Yes | 0 |
02/01/2022 | No | 0 |
03/01/2022 | No | 0 |
...inbetween dates | ...assume all "Yes" | ...assume all zero |
30/1/2022 | Yes | 0 |
31/1/2022 | Yes | 7 |
01/02/2022 | Yes | 8 |
for 01/02/2022: Average is calculated for the date range 01/01/2022-01/02/2022, 32 days but two of those are non-production days. Average = (7+8)/30 = 0.5