Function Problems

Display the Exact Number of Dates in a Selected Month in Excel

Tauseeq MagsiTauseeq Magsi Nov 18, 2026 870 views

Question details

Create a dynamic list of dates that includes only the days in a selected month.

Display the Exact Number of Dates in a Selected Month in Excel
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.
Before you start

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.

Solution 1Recommended

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.

1
Enter the month and year

Type the month number in B2 and the year in C2.

2
Enter the date formula

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.

3
Format the results

Select the spilled cells, then use Home > Number Format > Short Date or Long Date to display them as dates.

Generate the Month's Dates with SEQUENCE in Excel
If the formula cannot spill: Clear any existing content in the cells below A4. The list can require up to 31 rows.
WPS Spreadsheet

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. 1. Open a spreadsheet: Open WPS Spreadsheet and create or open a workbook.
  2. 2. Set the month and year: Enter a month number from 1 to 12 in B2 and a four-digit year in C2.
  3. 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. 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.
Adjusts the date list for short months and leap yearsOpens and edits Microsoft Excel XLSX and XLS filesProvides familiar spreadsheet formulas and formatting controlsAvailable as part of free WPS Office
microsoft office alternative - wps office

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.