Dynamic Array - Sequence Function - End of Month

mvbernot

New Member
Joined
Nov 25, 2006
Messages
13
Hi All,

I'm trying to design a budget workbook that would be able to take a budget start date and a budget end date and generate the End of Month dates for that period of time. I was trying to use the sequence command but cannot figure out how to input the increment criteria to generate this list of month end dates. The periods of time could range from 6, 12, 18 or 24 months. I saw that Mr Excel had a video on adding the + sign to the EOMonth function for a range that spilled (# reference) which was extremely helpful. Is this dynamic forumula possible? Thank you for any help you can provide.

Michael
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
A bit clunky, but how about
+Fluff New.xlsm
HI
1
201/01/202031/01/2020
301/08/202029/02/2020
431/03/2020
530/04/2020
631/05/2020
730/06/2020
831/07/2020
931/08/2020
10
11
Master
Cell Formulas
RangeFormula
I2:I9I2=EOMONTH(DATE(YEAR(H2),SEQUENCE(MONTH(H3)-MONTH(H2)+1,,MONTH(H2),),1),0)
Dynamic array formulas.
 
Upvote 0
Don't bother
a) It won't work across years
b) I have simplified it

Try
+Fluff New.xlsm
HI
1
201/01/202031/01/2020
301/08/202129/02/2020
431/03/2020
530/04/2020
631/05/2020
730/06/2020
831/07/2020
931/08/2020
1030/09/2020
1131/10/2020
1230/11/2020
1331/12/2020
1431/01/2021
1528/02/2021
1631/03/2021
1730/04/2021
1831/05/2021
1930/06/2021
2031/07/2021
2131/08/2021
22
Master
Cell Formulas
RangeFormula
I2:I21I2=EOMONTH(SEQUENCE(DATEDIF(H2,H3,"m")+1,,H2,32),0)
Dynamic array formulas.
 
Upvote 0
I was thinking the datedif function might be used, but couldn't get the results I was looking for. Let me give this a go!!! I will get back to you!! Thank you for your time!!
 
Upvote 0
I see that you are using a incremental amount of 32 in the sequence function. I guess over a longer period of time this might generate a list that might not include all the months Thank you very much! I appreciate the formula and will be using it in my workbook!!
 
Upvote 0
In that case we can go back to a modified version of the original
=EOMONTH(DATE(YEAR(H2),SEQUENCE(DATEDIF(H2,H3,"m")+1,,MONTH(H2)),1),0)
 
Upvote 0
I changed the incremental number from 32 to 31 and it worked over that time period. That was my struggle, how to find the proper increment to use in "sequence".
Let me try the original too.

MVB
 
Upvote 0
As long as you are only going to run it over 2 years a step of 31 will work, it fails in year 5.
 
Upvote 0

Forum statistics

Threads
1,215,852
Messages
6,127,313
Members
449,374
Latest member
analystvar

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