Display the Exact Number of Dates in a Selected Month in Excel
Question details
Create a dynamic list of dates that includes only the days in a selected month.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A user selects a month and year and wants a date list that updates automatically.
- Observed behavior
- The desired list runs from the first through the last date of the selected month, including February in leap years.
Enter a month number from 1 to 12 in cell B2 and a four-digit year in cell C2. Make sure the cells below your chosen output cell are empty so the date list has room to expand.
Generate the Month's Dates with SEQUENCE in Excel
Use this formula in an Excel version that supports dynamic arrays to spill the exact number of dates automatically.
Type the month number in B2 and the year in C2.
Select A4 and enter =SEQUENCE(DAY(EOMONTH(DATE(C2,B2,1),0)),,DATE(C2,B2,1)). Press Enter to spill the dates down the column.
Select the spilled cells, then use Home > Number Format > Short Date or Long Date to display them as dates.

Fill a Date Formula Down in Excel Without SEQUENCE
Use this method in Excel versions without dynamic arrays; unused rows remain blank.
Create a Dynamic Monthly Date List in WPS Spreadsheet
Use a fill-down formula in WPS Spreadsheet to show dates for the selected month and year, leaving unused rows blank.
- 1. Open a spreadsheet: Open WPS Spreadsheet and create or open a workbook.
- 2. Set the month and year: Enter a month number from 1 to 12 in B2 and a four-digit year in C2.
- 3. Add the formula: Select A4 and enter =IF(ROW(A1)<=DAY(EOMONTH(DATE($C$2,$B$2,1),0)),DATE($C$2,$B$2,ROW(A1)),"").
- 4. Fill and format the dates: Drag the fill handle from A4 through A34. Select A4:A34 and use the Home tab's number format control to apply a date format.

Frequently Asked Questions
Will the formula include February 29 in a leap year?
Yes. Enter 2 in B2 and the year in C2. EOMONTH finds the last day of that February, so the list includes February 29 when applicable.
Why do my results appear as numbers instead of dates?
Excel stores dates as serial numbers. Select the results and choose Home > Number Format > Short Date or Long Date.
Why does the SEQUENCE formula show a spill error?
A cell in the output range may contain data. Clear the cells below A4, leaving room for up to 31 dates, and check the formula again.
Can I use the formula if my Excel version does not support SEQUENCE?
Yes. Use the IF formula in the second solution and fill it from A4 through A34. Dates beyond the selected month's last day will appear blank.




