I need to average specific dates across several years

Mozzieman

New Member
Joined
Dec 1, 2017
Messages
3
I would like to average each date across several years. Data is pretty simple, only two columns of rough data, the date and the number to average. Data spans 12 years and I want to average the same date across all 12 years. Everything I have tried comes out as an error of some kind. Columns are about 35000 rows, but I can condense it to a smaller number of rows fairly easily (figured that one out earlier) once I can figure out the average thing.
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Welcome to the Board!

OK, let's say that you have data in rows 2 through 700 and:
- column A has valid dates
- column B has the values you want to average
- cell D1 has a valid date that has the month/day you want (it doesn't matter what year you pick, just as long as it is a valid date)

The following formula would average all the values where the month/day part of the date in column A matches the month/day part of the date in cell D1:
=SUMPRODUCT(--(MONTH(A2:A700)=MONTH(D1)),--(DAY(A2:A700)=DAY(D1)),B2:B700)/SUMPRODUCT(--(MONTH(A2:A700)=MONTH(D1)),--(DAY(A2:A700)=DAY(D1)))
 
Upvote 0
Note that we can simplify this a little bit more by using the TEXT function like this:
=SUMPRODUCT(--(TEXT(A2:A700,"mmdd")=TEXT(D1,"mmdd")),B2:B700)/SUMPRODUCT(--(TEXT(A2:A700,"mmdd")=TEXT(D1,"mmdd")))
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,917
Members
449,093
Latest member
dbomb1414

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