How to start formula after x rows

worldCurrencies

New Member
Joined
Mar 7, 2022
Messages
17
Office Version
  1. 365
Platform
  1. Windows
I am trying to take the 3 month moving average of a column of data. The dates are in descending order. How would I make it so that the formula doesnt start until after it has 3 months of data?
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
You haven't given us very much information here.

Let's say your data starts in row 2 (headers in row 1), dates are in column A and the data you want to average is in column B. You did not say if the data is daily, or if there are gaps in the dates. I will have to assume there are gaps. You can put your moving average in column C starting row 2:

Excel Formula:
=IF(MIN(A:A)>DATE(YEAR(A81),MONTH(A81)-3,DAY(A81)),"",AVERAGEIFS(B:B,A:A,"<="&A81,A:A,">="&DATE(YEAR(A81),MONTH(A81)-3,DAY(A81))))
 
Upvote 0
You haven't given us very much information here.

Let's say your data starts in row 2 (headers in row 1), dates are in column A and the data you want to average is in column B. You did not say if the data is daily, or if there are gaps in the dates. I will have to assume there are gaps. You can put your moving average in column C starting row 2:

Excel Formula:
=IF(MIN(A:A)>DATE(YEAR(A81),MONTH(A81)-3,DAY(A81)),"",AVERAGEIFS(B:B,A:A,"<="&A81,A:A,">="&DATE(YEAR(A81),MONTH(A81)-3,DAY(A81))))
My apologies, I will update the post. but the data is monthly data, not daily, therefore there are no gaps in dates. Column A has the monthly dates. Column b would have the value. Column C would have the 3-month moving average
 
Upvote 0
I am trying to take the 3 month moving average of a column of data. The dates are in descending order. How would I make it so that the formula doesnt start until after it has 3 months of data?
The data and dates are monthly data, not daily, therefore there are no gaps in dates. Column A has the monthly dates. Column b would have the value. Column C would have the 3-month moving average
 
Upvote 0
the data is monthly data, not daily, therefore there are no gaps in dates.
Actually it means that is a one-month gap between dates.

You can probably use a simpler formula. Are the dates the same day of the month each time?
 
Upvote 0

Forum statistics

Threads
1,214,965
Messages
6,122,500
Members
449,090
Latest member
RandomExceller01

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