Insert new dates with dynamic formula to include new range

NotTheBestAtExcel

New Member
Joined
Mar 19, 2024
Messages
3
Office Version
  1. 365
Platform
  1. Windows
I need to insert new dates as I add new dates I need to calculate the 4 wk, 8 wk, & 13 wk. For example, if I inserted 2/10/2024, I would need the formula to take into account the new date and provide the 4 wk, 8 wk, & 13 wk average.


I used this formula:
=ROUND(AVERAGE(OFFSET(D4, 0, COUNTA(D3:P3)-4, 1, 4))*4.33, 0)

But, when I inserted a new date into the column, the formula would not take into account the new date. Every month I'll be adding new dates and I need to formula to work dynamically.
 

Attachments

  • Data.png
    Data.png
    18.7 KB · Views: 8

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Hi & welcome to MrExcel.
How about
Excel Formula:
=ROUND(AVERAGE(TAKE(DROP(D5:R5,,-1),,-4))*4.33,0)
Change the -4 to -8 for the last 5 weeks
 
Upvote 0
=ROUND(AVERAGE(TAKE(DROP(D5:R5,,-1),,-4))*4.33,0)
Hello,

Thanks for helping. I tried the formula and I get the average of 0, looks like that didn't work. the 4 week average for 2/3 through 2/24 should be 74 for the ITEM "Test123"
 
Upvote 0
Oops forgot to change the range after testing, in Q5 it should
Excel Formula:
=ROUND(AVERAGE(TAKE(DROP(D5:Q5,,-1),,-4))*4.33,0)
 
Upvote 0
Figured it out, added INDEX
=ROUND(AVERAGE(INDEX(5:5,,COLUMN(Q5)-4):INDEX(5:5,,COLUMN(Q5)-1))*4.33,0)
 
Upvote 0
Solution

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

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