12 Month Rolling Time Period

SCADA

New Member
Joined
Mar 14, 2018
Messages
3
I have two worksheets in a workbook. Worksheet 1 is a data tabulation worksheet and at the end of each month is filled with data values and date as shown below. Worksheet 1 will always continue to fill in to the right with each new month and data value. Worksheet 2 has a table with 12 columns as I need this table to be a 12 month rolling period from the current month to the past 11 months. What I would like the table to do is look at the data in Worksheet 1 and then populate the table on Worksheet 2 such that the table contains only the data from Worksheet 1 Columns from the current month plus the past 11 months. For instance when the file runs on March 1, 2018 the table on Worksheet 2 would examine Worksheet 1 and be filled in with the vales from February 2018 to March 2017.

I'm not quite sure if this requires a macro or just some functions, but any help/guidance/ideas/suggestions would be appreciated.

Worksheet 1:
1/31/20182/28/2018etc...
196

<tbody>
</tbody>


Worksheet 2:
3/174/175/176/177/178/179/1710/1711/1712/171/182/18
196

<tbody>
</tbody>
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Hi,

Your description and your Sample does not match, this is based on your description, adjust formula with your sheet names and data range reference:


Book1
ABCDEFGHIJKLMNO
11/31/20172/28/20173/31/20174/30/20175/31/20176/30/20177/31/20178/31/20179/30/201710/31/201711/30/201712/31/20171/31/20182/28/20183/31/2018
219678911121314151617202122
3
4Feb-17Mar-17Apr-17May-17Jun-17Jul-17Aug-17Sep-17Oct-17Nov-17Dec-17Jan-18Feb-18Mar-18Apr-18
5192532404960728599114130147148163178
Sheet24
Cell Formulas
RangeFormula
A5=SUMIFS($A2:$O2,$A1:$O1,">="&EDATE(A4,-12),$A1:$O1,"<"&A4)


Formula copied across.
 
Upvote 0
I apologize for my lack of detail in my original description. I will try another attempt at explaining what I am trying to do.



12/31/20161/31/20172/28/20173/31/20174/30/20175/30/20176/30/20177/31/20178/30/20179/30/201710/31/201711/30/201712/31/20171/31/20182/28/2018
507150704150704
414241405241405
308330806330806
224422403422403
105510516510516

<colgroup><col span="8"><col span="3"><col span="3"><col></colgroup><tbody>
</tbody>

So here is my table of Data. As you can see I have more than the past 12 months of data.

201720172017201720172017201720172017201720182018
MarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecemberJanuaryFebruary

<colgroup><col span="5"><col span="3"><col span="3"><col></colgroup><tbody>
</tbody>
Here is the table I would like to populate. Forgive me for not pasting them as you have, I am new to this site and not sure how to past things in a table like format like you have. The code for each of the columns in the table is like:

=EDATE(TODAY(),-1)
=EDATE(TODAY(),-2)
=EDATE(TODAY(),-3)

So on and so forth for 12 months. and then the cells are formatted to display only Month and Year.

My question is then how do I evaluate all of the data at the top, in this case 15 months of data, and have the table sum all of the values below the date if it corresponds to the table's EDATE equation? My example final product would look something like:

201720172017201720172017201720172017201720182018
MarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecemberJanuaryFebruary
15153281241515328124

<colgroup><col span="5"><col span="3"><col span="3"><col></colgroup><tbody>
</tbody>

I only want the sums of the most recent 12 months.
 
Upvote 0
Your 1st Table (Data Table) in Post #3 , for the month of May and August, instead of End of the month, you have the 30th, I assume that's a typo, since All other months shows last day of the month:


Book1
ABCDEFGHIJKLMNO
112/31/20161/31/20172/28/20173/31/20174/30/20175/31/20176/30/20177/31/20178/31/20179/30/201710/31/201711/30/201712/31/20171/31/20182/28/2018
2507150704150704
3414241405241405
4308330806330806
5224422403422403
6105510516510516
7
8Mar-17Apr-17May-17Jun-17Jul-17Aug-17Sep-17Oct-17Nov-17Dec-17Jan-18Feb-18
915153281241515328124
Sheet24
Cell Formulas
RangeFormula
A9=SUMPRODUCT(($A1:$O1=EOMONTH(A8,0))*($A2:$O6))


A9 formula copied across.
 
Upvote 0
You're welcome, welcome to the forum.
 
Upvote 0

Forum statistics

Threads
1,215,079
Messages
6,123,009
Members
449,093
Latest member
ikke

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