Dynamic Array For Dates Using SEQUENCE()

Cubist

Well-known Member
Joined
Oct 5, 2023
Messages
2,139
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I want to generate the end-of-month array given 2 inputs:
(1) the start date - The start date input can be any day of the month but I want the result array to always be end-of-month.
(2) The length of the array.

I need dynamic array so I don't need to manually copy down the formulas every time.
See the sample below:
Cell Formulas
RangeFormula
B4B4=EOMONTH(B1,0)
B5:B29B5=EOMONTH(B4,0)+1
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
It should end-of-month.

Book1
C
41/31/2022
52/31/2022
63/31/2022
74/31/2022
85/31/2022
96/31/2022
107/31/2022
118/31/2022
129/31/2022
1310/31/2022
1411/31/2022
1512/31/2022
161/31/2023
172/31/2023
183/31/2023
194/31/2023
205/31/2023
216/31/2023
227/31/2023
238/31/2023
249/31/2023
2510/31/2023
2611/31/2023
2712/31/2023
281/31/2024
292/31/2024
Sheet1
 
Upvote 0
try
on Cell B4: =EOMONTH(B1,0)
on cell B5: =EOMONTH(B4+1,0) then drag til B29
 
Upvote 0
Perhaps try this instead?
Book5
AB
1Start Date25-Jan-22
2Length26
3
4Output31-Jan-22
528-Feb-22
631-Mar-22
730-Apr-22
831-May-22
930-Jun-22
1031-Jul-22
1131-Aug-22
1230-Sep-22
1331-Oct-22
1430-Nov-22
1531-Dec-22
1631-Jan-23
1728-Feb-23
1831-Mar-23
1930-Apr-23
2031-May-23
2130-Jun-23
2231-Jul-23
2331-Aug-23
2430-Sep-23
2531-Oct-23
2630-Nov-23
2731-Dec-23
2831-Jan-24
2929-Feb-24
Sheet1
Cell Formulas
RangeFormula
B4:B29B4=EOMONTH(B1,SEQUENCE(B2,,0))
Dynamic array formulas.
 
Upvote 0
Solution
Perhaps try this instead?
Book5
AB
1Start Date25-Jan-22
2Length26
3
4Output31-Jan-22
528-Feb-22
631-Mar-22
730-Apr-22
831-May-22
930-Jun-22
1031-Jul-22
1131-Aug-22
1230-Sep-22
1331-Oct-22
1430-Nov-22
1531-Dec-22
1631-Jan-23
1728-Feb-23
1831-Mar-23
1930-Apr-23
2031-May-23
2130-Jun-23
2231-Jul-23
2331-Aug-23
2430-Sep-23
2531-Oct-23
2630-Nov-23
2731-Dec-23
2831-Jan-24
2929-Feb-24
Sheet1
Cell Formulas
RangeFormula
B4:B29B4=EOMONTH(B1,SEQUENCE(B2,,0))
Dynamic array formulas.
Thanks, that works!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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