Average a Range of Data by Finding a Starting Month

seasea123

New Member
Joined
Dec 11, 2023
Messages
13
Office Version
  1. 365
Platform
  1. Windows
Can you please help build a formula in column AA? We would like the formula to average the 3 months prior to the month of change. In this case the month of change is Oct 23, so it should average Sep 23, Aug 23 and Jul 23. We'd like the formula to be dynamic for different months of change.

1702336088170.png
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Can you please help build a formula in column AA? We would like the formula to average the 3 months prior to the month of change. In this case the month of change is Oct 23, so it should average Sep 23, Aug 23 and Jul 23. We'd like the formula to be dynamic for different months of change.

View attachment 103356
Column AA is the cell that's highlighted in yellow.
 
Upvote 0
Try this:

2023-12-11.2.xlsx
TUVWXYZAA
1NameJul-23Aug-23Sep-23Oct-23Nov-23Month of changeBaseline (3 month avg. Prior to change)
2Smith, Bob3226273230Oct-2328.3
3^Based on month of change (Oct. 23), should average Sep. 23, Aug 23 and Jul 23 ((26+27+32)/3=28.3)
Sheet1
Cell Formulas
RangeFormula
AA2AA2=AVERAGE(INDEX($U$1:$Y$2,2,MATCH($Z$2,$U$1:$Y$1,0)-1),INDEX($U$1:$Y$2,2,MATCH($Z$2,$U$1:$Y$1,0)-2),INDEX($U$1:$Y$2,2,MATCH($Z$2,$U$1:$Y$1,0)-3))
 
Upvote 0
Or try this:

Book1
TUVWXYZAA
1NameJul-2023Aug-2023Sep-2023Oct-2023Nov-2023Month of changeBaseline (3 month avg. Prior to change)
2Smith, Bob3226273230Oct-202328.3
3^Based on month of change (Oct. 23), should average Sep. 23, Aug 23 and Jul 23 ((26+27+32)/3=28.3)
Sheet1
Cell Formulas
RangeFormula
AA2AA2=AVERAGEIFS(U2:Y2,$U$1:$Y$1,"<="&Z2,$U$1:$Y$1,">"&EDATE(Z2,-3))
 
Upvote 0
Another option
Excel Formula:
=AVERAGE(TAKE(FILTER(U2:Y2,$U$1:$Y$1<Z2),,-3))
 
Upvote 0
Thank you! How will these formula differ if there are multiple rows of data?
 
Last edited by a moderator:
Upvote 0
What do you mean by multiple different rows?
 
Upvote 0
Should each row be averaged individually?
 
Upvote 0

Forum statistics

Threads
1,215,338
Messages
6,124,349
Members
449,155
Latest member
ravioli44

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