ARRAY TO AVERAGE 22 DAYS ON OR BEFORE DATE

ja189704

New Member
Joined
Jan 25, 2022
Messages
5
Office Version
  1. 2021
Platform
  1. Windows
Hello.

I need to calculate the 22 day average of a stock at the end of a quarter.

So, in 2019 March 31 was on a weekend so the last day in March was 29. I want the average of the 22 days that ended on March 29.

If it ended on March 31 I am able to figure it out. But I suspect I need to use a match or something.

Thanks.
 

Attachments

  • EXCEL HELP.PNG
    EXCEL HELP.PNG
    91.1 KB · Views: 6

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Your row number don't quite make it into the picture but assuming the dates start in A1 and the date you are trying to match is in N11 then this equation should do it:
Excel Formula:
=AVERAGE(OFFSET($A$1,MATCH(N11,$A$1:$A$261,1)-22,4,22))
 
Upvote 0
Your row number don't quite make it into the picture but assuming the dates start in A1 and the date you are trying to match is in N11 then this equation should do it:
Excel Formula:
=AVERAGE(OFFSET($A$1,MATCH(N11,$A$1:$A$261,1)-22,4,22))
AMAZING! THANKS SO MUCH!
 
Upvote 0

Forum statistics

Threads
1,214,389
Messages
6,119,232
Members
448,879
Latest member
VanGirl

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