Work out Averages of completed Months

drewberts

Board Regular
Joined
Sep 5, 2013
Messages
177
Office Version
  1. 365
Platform
  1. Windows
I have a dashboard sheet which calculates the sales totals for each month (from an separate invoice sheet) based on a financial year start date. I type in the financial year start date into a cell (A1) and A2,A13 etc calculates each month for that year starting with the start date. Column B the uses SUMIFS to total the sales for each of those months (this bit all works fine).

What I want to do is work out the monthly invoice average for the completed months and for this to auto calculate each time a completed month ends. So for example I want in Cell D1 the average for the 5 completed months so far this year (Jan-May) even though Col A has all the way to Dec 2022. The current Month (June) needs to be ignored in the average formula as it is updating each time an invoice is added to the invoice sheet and therefore throws out the average calculation. I can easily ignore the future months as these are zero but I'm looking to also exclude the current month as well (but this isn't zero).

I also need the average formula to include June when we tip over into July, but then exclude July as that will have a non-zero invoice total as the month progresses.

Hope that makes sense🤞
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
if you averageifs on board
Book1
ABCDEFGH
12022Avrg Sales
231/01/2022$ 154,40DateSales
328/02/2022$ 180,953/01/2022$ 117,20
431/03/2022$ 143,0624/04/2022$ 247,80
530/04/2022$ 194,6125/02/2022$ 148,21
631/05/2022$ 112,2825/03/2022$ 147,08
730/06/2022$ 259,002/03/2022$ 108,99
831/07/2022 12/01/2022$ 113,66
931/08/2022 16/04/2022$ 181,24
1030/09/2022 20/02/2022$ 181,97
1131/10/2022 5/03/2022$ 135,67
1230/11/2022 11/01/2022$ 137,82
1331/12/2022 20/04/2022$ 185,39
1418/03/2022$ 144,03
1522/03/2022$ 179,55
1620/02/2022$ 188,23
1722/05/2022$ 112,28
187/07/2022$ 147,19
191/07/2022$ 193,88
203/02/2022$ 205,37
2115/06/2022$ 150,79
2216/06/2022$ 367,20
2330/04/2022$ 163,99
2431/01/2022$ 248,90
25
Sheet2
Cell Formulas
RangeFormula
A2:A13A2=EOMONTH(DATE(A1,SEQUENCE(12),1),0)
B2:B13B2=IF(TODAY()>=A2,AVERAGEIFS($G$3:$G$24,$F$3:$F$24,"<="&A2,$F$3:$F$24,">"&EOMONTH(A2,-1)),"")
Dynamic array formulas.
 
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