Excel Formula To Average all numbers in one month from list of dates

JEF13

New Member
Joined
Jun 30, 2018
Messages
49
Office Version
  1. 2019
I have three years of dates starting in A2 and running through A984. In cells B2 through B984 I have a list of values.

A sample of the date looks like:

5/17/2023 90
5/18/2023 88
5/19/2023 89
5/20/2023 90
5/21/2023 91
5/22/2023 93
5/23/2023 91
5/24/2023 89
5/25/2023 90
5/26/2023 87
5/27/2023 90
5/28/2023 83
5/29/2023 85

Is there a formula that can:

1. Provide an average for all the numbers that are in one month
2. Create two new entries:
A. The month
B. The average for the month

The output would look like:

05-2023 92
06-2023 89
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Try this:
I just realizzed this uses text after and text before which are not in 2019. I hope you can figure out a parsing formula for the date and value column.
Although, I really unsure if you have all the data in one column (or two already).

Mr excel questions 66.xlsm
ABCDEFG
1Month/YearAverage
25/17/2023 902023-05-17902023-0588.9230769
35/18/2023 882023-05-18882023-0490.3333333
45/19/2023 892023-05-19892023-0387.3333333
55/20/2023 902023-05-2090
65/21/2023 912023-05-2191
75/22/2023 932023-05-2293
85/23/2023 912023-05-2391
95/24/2023 892023-05-2489
105/25/2023 902023-05-2590
115/26/2023 872023-05-2687
125/27/2023 902023-05-2790
135/28/2023 832023-05-2883
145/29/2023 852023-05-2985
154/18/2023 882023-04-1888
164/19/2023 892023-04-1989
174/20/2023 902023-04-2090
184/21/2023 912023-04-2191
194/22/2023 932023-04-2293
204/23/2023 912023-04-2391
213/24/2023 892023-03-2489
223/23/2023 902023-03-2390
233/26/2023 872023-03-2687
243/27/2023 902023-03-2790
253/28/2023 832023-03-2883
263/29/2023 852023-03-2985
JEF13
Cell Formulas
RangeFormula
B2:B26B2=DATE(TEXTAFTER(TEXTBEFORE(A2," "),"/",2),TEXTBEFORE(A2,"/",1),TEXTAFTER(TEXTBEFORE(A2,"/",2),"/"))
C2:C26C2=TEXTAFTER(A2," ")*1
E2E2=EOMONTH(MAX(B2:B26),-1)+1
F2:F4F2=SUM(((MONTH(E2)=MONTH($B$2:$B$26))*(YEAR(E2)=YEAR($B$2:$B$26))*($C$2:$C$26)))/ SUM((MONTH(E2)=MONTH($B$2:$B$26))*(YEAR(E2)=YEAR($B$2:$B$26)))
E3:E4E3=EDATE(E2,-1)
 
Last edited:
Upvote 0
T202310a.xlsm
BCDEF
1
217-May-239001-Mar-202387.33
318-May-2388Apr-2390.33
419-May-2389May-2388.92
520-May-2390
621-May-2391
722-May-2393
823-May-2391
924-May-2389
1025-May-2390
1126-May-2387
1227-May-2390
1328-May-2383
1429-May-2385
1518-Apr-2388
1619-Apr-2389
1720-Apr-2390
1821-Apr-2391
1922-Apr-2393
2023-Apr-2391
2124-Mar-2389
2223-Mar-2390
2326-Mar-2387
2427-Mar-2390
2528-Mar-2383
2629-Mar-2385
2a
Cell Formulas
RangeFormula
F2:F4F2=AVERAGEIFS($C$2:$C$26,$B$2:$B$26,">="&E2,$B$2:$B$26,"<="&EOMONTH(E2,0))
 
Upvote 0
Solution

Forum statistics

Threads
1,224,823
Messages
6,181,173
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