How to Update Calendar Dates Automatically by Selecting Year and Month in Excel
Question details
The user needs a formula to automatically generate and update calendar dates based on specific year and month input cells.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Creating a dynamic calendar where dates increment automatically when the user changes the control cells for year and month.
- Observed behavior
- The calendar seamlessly updates the day numbers and weekday names to match the selected year and month.
Ensure you have two designated control cells (e.g., B1 for the Year and E1 for the Month) set up in your worksheet before applying the dynamic date formulas.
Use the DATE Function to Create a Dynamic Calendar
This method uses the DATE function to establish the first day of the month and simple addition to fill out the rest of the calendar.
The DATE function requires three arguments: year, month, and day. By referencing your control cells for the year and month, and setting the day to 1, you can establish the starting point. Subsequent cells simply add 1 to the previous date.
Select your starting cell (e.g., D4). Enter the formula =DATE($B$1,$E$1,1), replacing $B$1 with your Year cell and $E$1 with your Month cell. Right-click the cell, go to 'Format Cells', choose 'Custom', and type "ddd" to display the abbreviated weekday.
In the next cell (e.g., E4), enter =D4+1. Press Enter, then drag the fill handle to the right (up to AH4) to generate the remaining days of the month.
In the cell directly below the first date (e.g., D5), type =D4. Drag this formula to the right to match the row above. Select this new row, open 'Format Cells', choose 'Custom', and type "d" to show only the day number.

Create Dynamic Calendars in WPS Spreadsheet
WPS Spreadsheet fully supports Excel's DATE function and custom formatting, making it perfectly suited for building dynamic trackers, schedules, and calendars.
- 1. Open WPS Spreadsheet: Launch WPS Office and open a new or existing spreadsheet where you want to build your calendar.
- 2. Input control values: Enter the desired year and month into two specific cells to act as your dynamic controls.
- 3. Apply the DATE formula: Use the =DATE(year, month, 1) formula to fetch the first day, and format the cells using the extensive custom formatting options in WPS Spreadsheet.

Frequently Asked Questions
How do I hide the extra days if a month only has 28 or 30 days?
You can wrap your date increment formula in an IF statement. For example, =IF(D4="","",IF(MONTH(D4+1)<>$E$1,"",D4+1)) ensures that once the month changes, the remaining cells stay blank.
Why does my date cell show a series of hashtags (####)?
This usually happens when the column is not wide enough to display the formatted date. You can fix this by double-clicking the right boundary of the column header to auto-fit the width.
Can I make the weekends highlight automatically in my dynamic calendar?
Yes, you can use Conditional Formatting. Select your calendar range, go to Conditional Formatting > New Rule, and use a formula like =OR(WEEKDAY(D4)=1, WEEKDAY(D4)=7) to apply a specific background color to Saturdays and Sundays.




