The SEQUENCE function can be used to generate numeric sequences of all kinds.
Since Excel dates are just numbers, SEQUENCE works well for generating dates.
I’ll enter the SEQUENCE function in cell E5 and configure it to use these inputs.
Therowsargument corresponds to the number of dates we want, so we want to use C5.
Forcolumns, we want 1.
Forstart, we pick up the value in C4.
Finally, forstep, I’ll enter 1, since we want these dates to be consecutive.
When I enter the formula, we get a list of 7 dates starting on May 1.
One thing I want to mention is that I’ve already formatted cells in column E as dates.
If you see numbers like this when you expect to see dates, you need toapply date formatting.
We’ll do this with help from the “end of month” orEOMONTH function.
C4 contains the start date.
In C5, we’ll use the end of month function.
In this case, because we want to stay in the same month, we use zero formonths.
In C6, we’ll calculate total days.
This is the end date minus the start date,plus 1.
Now in E5, I’ll enter the SEQUENCE function.
Columnsis 1
And we getstartfrom C4.
When I enter the formula, SEQUENCE returns the 31 dates in May.
Notice I can change the start date to any month I like and the formula continues to work properly.