In this guide, we’ll show you how to create a dynamic calendar in Excel for Microsoft 365. When you select a year, Excel will automatically generate the days for all twelve months, without requiring you to manually update each date. The complete formula requires the latest version of Microsoft 365 or Excel 2024, as it uses dynamic array functions that aren’t available in earlier versions.

In our example, we’ve added a conditional formatting rule to highlight weekends, that is, Saturdays and Sundays, with an orange background and white text. The year is selected via a drop-down menu to make it easier to enter.
Holidays are not included in the current version of the file. If you’d like to highlight them, you could add a separate table and use a second conditional formatting rule.
If you’d rather download a ready-made calendar, check out the 2027 Excel calendar!
How to Create a Monthly Calendar in Excel

Let’s take a look at the formula that allows us to create a monthly calendar in Excel. The result will consist of twelve columns, one for each month, with the days arranged vertically. The year is read from cell B2: changing that value automatically updates the calendar.
=LET(months,SEQUENCE(,12),
start,DATE(B2,1,1),
end,EDATE(start,12),
seq,SEQUENCE(end-start,,start),
red,REDUCE("",months,LAMBDA(acc,v,HSTACK(acc,FILTER(seq,MONTH(seq)=v)))),
final,IFERROR(DROP(red,,1),""),
months_array,TAKE(final,1),
output_real,VSTACK(UPPER(TEXT(months_array,"mmmm")),final),
output_real)Let’s go through the individual steps:
- "months" contains all the months from 1 to 12, thanks to the function SEQUENCE, which will span multiple columns
- "start" indicates the first day of the specified year, using the DATE function. Enter the year in cell B2
- `end` represents the first day of the following year. The difference between `end` and `start` allows us to automatically determine the number of days in the year, including leap years
- `seq` generates all dates from the first to the last day of the year. Excel dates are sequential numbers, so we can use `start` as the initial value for `SEQUENCE` and the previously calculated number of days as the number of rows
Now comes the tricky part, because for now we only have the months, the first day of the year, the last day, and all the individual dates between the first and last days of the year.

Red is created by REDUCE, which essentially does this: we’ll take all our months, from 1 to 12 (months). There will then be an iterative loop where Excel, using FILTER and MONTH, will return all the values for the individual months. So we’ll have the dates for January, February, March, and so on (which are the numbers 1, 2, 3 in our example).
Since REDUCE operates iteratively, we want to keep our results for each individual month in memory and in the file. In this case, we work with HSTACK, which essentially creates a stack with the accumulator, that is, the result of the previous iteration, and the result of the current FILTER. Not all months are the same length: February has 28 or 29 dates, while the others have 30 or 31. When HSTACK concatenates these matrices, it fills in the missing positions with errors, which we’ll handle in the next step.
To clarify: for January, the result will be an entire column of empty values (the first accumulator value, "", in REDUCE) | a column of January dates (obtained by filtering only the dates where month = 1).
For February, we’ll have: an entire column of empty values | January dates | February dates, since the value we’re now considering is 2, not 1. 1 generated the previous iteration; now we move on to the next one, and we’ll continue this way up to value 12.
The final result looks something like this: we’ll have 13 columns with our data, and for each one, the data will be in order. It’s clear here that we no longer need the first column, so we’ll remove it by defining `final`.
`Final` will be the result of `red`, but with `DROP` used to remove the first empty column created by the initial accumulator `REDUCE`. The month matrices have a different number of rows, and when placed side by side, the missing positions result in an error. Using IFERROR, we convert them into empty cells, retaining only the correct dates for each month.
At this point, I thought of a way to still display the month names dynamically. There are many different ways to do this, but I liked the idea of keeping everything compact in a single formula. Using TAKE, Months_array retrieves only the value for the first day of each month. This is the value we’ll use to dynamically return the month’s name.
Output_real does exactly that, first concatenating the values of the first day of the month from Months_array, and then adding Final, which contains all our correct dates. To improve the appearance of the header, which would be Months_array, we use the function UPPER, which converts everything to uppercase. In this case, we capitalize the result of the TEXT function, which returns only the month name, starting with the first day of the month. We need UPPER simply because otherwise the headers would have been “January,” “February,” and so on.
At this point, we tell LET that we want to see Output_real, and voilà, our formula is complete!
How to Create a Monthly Calendar with Excel and LAMBDA
We can reuse the previous formula to create a LAMBDA that lets us create a calendar in Excel in one go.

Our formula, in this case, will be:
=LAMBDA(year,LET(months,SEQUENCE(,12),
start,DATE(year,1,1),
end,EDATE(start,12),
seq,SEQUENCE(end-start,,start),
red,REDUCE("",months,LAMBDA(acc,v,HSTACK(acc,FILTER(seq,MONTH(seq)=v)))),
final,IFERROR(DROP(red,,1),""),
months_array,TAKE(final,1),
output_real,VSTACK(UPPER(TEXT(months_array,"mmmm")),final),
output_real))
Essentially, since we’ve created a formula with several steps, we just need to pull out the cell containing the year we’re interested in, and this becomes the only information the user needs to enter.
We can then copy this formula > Formulas > Define Name and enter it in the “Refers to” field. We can choose any name we like: in this case, I entered ANNUAL_CALENDAR, which will become a true custom function for our file. After defining the name, we can call it in any empty cell by typing =ANNUAL_CALENDAR(B2). The only required argument is the year to use for generating the calendar.
Conclusions
We've seen how to create a dynamic monthly calendar in Excel that updates when you change just one cell. The formula with LET lets us follow all the steps, while LAMBDA makes the solution easier to reuse. Depending on your file, you can customize colors and formatting rules or add a table dedicated to holidays.
To learn more about LAMBDA functions in Excel, check out this guide!
