Calculating multiple averages of periods indicated by increasing values

Keen_to_learnExcel

New Member
Joined
Jun 9, 2020
Messages
3
Office Version
  1. 2010
Platform
  1. Windows
Hi all,

I have a problem, I want to calculate the mean of daily production over a period of time, but this period is very different per case. Below you can see one case, in reality the row is much longer but for practical reasons in shortened the different periods. The top row indicates the day in the period that the day-production is measured. All cases have a different number periods and the periods differ in length. It is also possible that the case only has one period. I added colours to indicate the different periods, these colours aren’t present in my excel file.

1592993198837.png


Now I’m looking for a formula that gives me the average of a period. An indicator of a period is that the row "Day" is increasing, when the period is over the value in row "Day" decreases to a low number. Can someone help me with a formula that automatically calculates the average of one period? So that the results look something like here below.

1592993206040.png


I tried to fix it myself but unfortunately I didn’t come close to a good solution. Any ideas how I can find a good solution are welcome.
Much thanks in advance.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
if the Day/KgM values were in B1:Q2 then, per XL2010, one option {a little brute force} might be:

B4: =AVERAGE(INDEX($2:$2;AGGREGATE(15;6;COLUMN($B$1:$Q$1)/(($B$1:$Q$1<$A$1:$P$1)+($A$1:$P$1=""));ROWS(B$4:B4))):INDEX($2:$2;AGGREGATE(15;6;COLUMN($B$1:$Q$1)/(($B$1:$Q$1>N(+$C$1:$R$1)));ROWS(B$4:B4))))
copied down

the above would replicate your expected results
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,906
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top