Avarage of rolling 12 months

nburaq

Board Regular
Joined
Apr 2, 2021
Messages
222
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi,
I have monthly data of year 2022 and year 2023. I would like to get average of last 12 months as data entered for 2023. Here is the table ;

DatumLocation1
Jan/2243,70
Feb/222,24
Mar/2228,96
Apr/2225,57
May/2241,19
Jun/2237,42
Jul/2241,88
Aug/2237,37
Sep/2239,31
Oct/2238,79
Nov/2237,91
Dec/2240,40
Jan/2374,69
Feb/2359,99
Mar/2360,69
Apr/2360,69
May/2352,00
Jun/23
Jul/23
Aug/23
Sep/23
Oct/23
Nov/23
Dec/23

So , as soon as I entered data for JUN/23 it will give me the average of jun/23- jul/22. My approach was like this but I could not complete my function because I could not find how to concatenate number and text to make cell ref.

=AVARAGE(E&(MIN(IF(E3:E26="";ROW(E3:E26)))-1):E&((MIN(IF(E3:E26="";ROW(E3:E26)))-11))

I will be so glad if you can help me.

Thanks again

1689688227304.png
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
How about
Excel Formula:
=AVERAGE(TAKE(FILTER(E3:E26,E3:E26<>""),-12))
 
Upvote 1
Solution
How about
Excel Formula:
=AVERAGE(TAKE(FILTER(E3:E26,E3:E26<>""),-12))
Hi Fluff
Thanks for your help and quick reaction. It would be a perfect solution if data of every month was entered. For example, if Jan/23 data is not available and left empty then formula will not work as it is planned.

Ok, Sorry,I was wrong it works great I dont know how!!! amazing thanks again!!!!!
 
Last edited:
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
Should I open a new title or keep going from here but if I need to use this formula with COUNTIF(Range; ">30") How can I do that ?
Thanks again
 
Upvote 0
That would appear to be a different question & so needs a new thread. Thanks
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,179
Members
453,021
Latest member
Justyna P

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