ID EN
#Date and time

DAY

Excel Functions

Get the day of month from a date

Syntax

EXCEL
=DAY(date)

Arguments

Parameter Description
date A valid Excel date.

Return Value

The day of month as a number between 1-31

Details

The DAY function extracts the day component from any valid Excel date. For example, DAY returns 15 from the date January 15, 2024. This is useful when you need to work with the day of a date separately, for calculations, comparisons, or building new dates. The DAY function returns a number. If you need a day's name, use the TEXT function as shown below. The DAY function requires just one argument, a valid Excel date. When given a valid date, it returns the day of the month: 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 month and day the same, you can "take apart" the date with YEAR, MONTH, and DAY, then reassemble it with DATE: This returns a new date with the year 2025, but the original

Examples

Basic usage

The DAY function requires just one argument, a valid Excel date. When given a valid date, it returns the day of the month:

EXCEL
=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
Basic usage

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

EXCEL
=DATE(2025,MONTH(A1),DAY(A1))
Get day from date

In the worksheet below, the goal is to extract the day number from dates in column B. The formula in C5 is:

EXCEL
=DAY(B5)
Get first day of month

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

EXCEL
=B5-DAY(B5)+1
Get first day of month

For example, with the date January 12, 2025 in B5:

EXCEL
=B5-DAY(B5)+1
="12-Jan-2025"-12+1
="31-Dec-2024"+1
="1-Jan-2025"
Days in month

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

EXCEL
=DAY(EOMONTH(B5,0))

See Also

YEAR MONTH DATE EOMONTH