Sum/Avg a Quarter from a full monthly Year

shepcs

Board Regular
Joined
Feb 2, 2003
Messages
72
Office Version
  1. 365
Platform
  1. Windows
Appreciate any help on how to elegant sum for a quarter given the date (or specified quarter number). I can create a switch simply by the quarter number (just hardcoded 1s below) but there might be an easier way? I would need to also average it. Really appreciate any pointers!



MrExcel.xlsx
CDEFGHIJKLMNOPQ
1Report Month7
2Report Quarter3
3Report Year2024
4End of Month07/31/24
5
6111
7Jan-24Feb-24Mar-24Apr-24May-24Jun-24Jul-24Aug-24Sep-24Oct-24Nov-24Dec-242024
8TOTAL
9
10ENERGY MARGIN
11600100REVENUE - ENERGY SALES-------------
12600105REVENUE - ENERGY - REAL TIME-------------
13600110REVENUE - ENERGY - DAY AHEAD483,987751,160709,401828,741585,2811,095,8142,259,5052,102,3081,135,976681,8051,064,370681,29112,379,639
14
15
16
17Q3
Sheet1
Cell Formulas
RangeFormula
D2D2=ROUNDUP(D1/3,0)
D4D4=EOMONTH(DATE(D3,D1,1),0)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D4Expression=#REF!<>0textYES
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Like this perhaps?

Book1
CDEFGHIJKLMNOPQ
1Report Month7
2Report Quarter3
3Report Year2024
4End of Month45504
5
6
731/01/202429/02/202431/03/202430/04/202431/05/202430/06/202431/07/202431/08/202430/09/202431/10/202430/11/202431/12/20242024
8TOTAL
9
10ENERGY MARGIN
11600100REVENUE - ENERGY SALES0000000000000
12600105REVENUE - ENERGY - REAL TIME0000000000000
13600110REVENUE - ENERGY - DAY AHEAD483987.4633751159.7176709401.4219828741.3224585281.29411095813.622259504.7272102307.5781135975.803681804.99031064369.951681291.08461E+07
14
15
16SumAverage
17Q31944548.6216060.96
Sheet1
Cell Formulas
RangeFormula
D2D2=ROUNDUP(D1/3,0)
D4D4=EOMONTH(DATE(D3,D1,1),0)
D17D17=SUM(FILTER($E$11:$P$13,CHOOSE(MONTH($E$7:$P$7),3,3,3,4,4,4,1,1,1,2,2,2)=$D$2))
E17E17=AVERAGE(FILTER($E$11:$P$13,CHOOSE(MONTH($E$7:$P$7),3,3,3,4,4,4,1,1,1,2,2,2)=$D$2))
 
Upvote 0
Thanks! Sorry for the delay. That's not summing it or averaging it correctly? I'm trying to play with it and make it row specific by column C. 6001110 for example.
 
Upvote 0
It is summing correctly - make sure you ask for what you want, preferably with an example of desired results.

Try this.

Book3
BCDEFGHIJKLMNOPQ
1Report Month7
2Report Quarter3
3Report Year2024
4End of Month31/07/2024
5
6
731/01/202429/02/202431/03/202430/04/202431/05/202430/06/202431/07/202431/08/202430/09/202431/10/202430/11/202431/12/20242024
8TOTAL
9
10ENERGY MARGIN
11600100REVENUE - ENERGY SALES5000000000000
12600105REVENUE - ENERGY - REAL TIME0000000000000
13600110REVENUE - ENERGY - DAY AHEAD483987.4633751159.7176709401.4219828741.3224585281.29411095813.622259504.7272102307.5781135975.803681804.99031064369.951681291.08461E+07
14
15
16SumAverage
17Q360010051.666666667
1860010500
196001101944548.603648182.8676
Sheet1
Cell Formulas
RangeFormula
D2D2=ROUNDUP(D1/3,0)
D4D4=EOMONTH(DATE(D3,D1,1),0)
D17:D19D17=SUM(FILTER(FILTER($E$11:$P$13,(CHOOSE(MONTH($E$7:$P$7),3,3,3,4,4,4,1,1,1,2,2,2)=$D$2)),$C$11:$C$13=$C17))
E17:E19E17=AVERAGE(FILTER(FILTER($E$11:$P$13,(CHOOSE(MONTH($E$7:$P$7),3,3,3,4,4,4,1,1,1,2,2,2)=$D$2)),$C$11:$C$13=$C17))
 
Upvote 0

Forum statistics

Threads
1,224,815
Messages
6,181,136
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