Get the day of month from a date
=DAY(date)
| Parameter | Description |
|---|---|
date |
A valid Excel date. |
The DAY function requires just one argument, a valid Excel date. When given a valid date, it returns the day of the month:
=DAY("15-Jan-2024") // returns 15
=DAY(TODAY()) // returns today's day number
=DAY(A1) // returns day from date in A1
=DAY("7-Aug-2025") // returns 7
=DAY("31-Dec-2024") // returns 31
A common pattern is to use DAY together with YEAR, MONTH, and DATE to modify dates. For example, to change only the year of a date while keeping the m
=DATE(2025,MONTH(A1),DAY(A1))
In the worksheet below, the goal is to extract the day number from dates in column B. The formula in C5 is:
=DAY(B5)
Before the EOMONTH function was introduced, the DAY function was the standard way to get the first day of a month. In the worksheet below, the goal is
=B5-DAY(B5)+1
For example, with the date January 12, 2025 in B5:
=B5-DAY(B5)+1
="12-Jan-2025"-12+1
="31-Dec-2024"+1
="1-Jan-2025"
Since the last day of any month equals the total number of days in that month, you can combine DAY with EOMONTH to count days in a month. In the works
=DAY(EOMONTH(B5,0))