Excel function

DAYfunction

Returns the day (1–31) of a date as a number.

All versions
=DAY(DATE(2026,5,4))

May 2026

Sun
Mon
Tue
Wed
Thu
Fri
Sat

Click a date on the calendar to change serial_number. Use the ◀ ▶ buttons to move a day at a time past the end of a month or year. Try breaking it on purpose to see the errors.

Result

4

serial_number
May 4, 2026 (Mon)

The date to take the day from. In a real sheet this is usually a cell with a date (A2 and so on).

What is the DAY function?

=DAY(serial_number)

DAY returns only the day of a date as a number: an integer from 1 to 31.

Inside Excel a date is a serial number (January 1, 1900 is 1), so it is hard to calculate with the year, month and day directly. Taking them apart with YEAR, MONTH and DAY lets you test conditions or build other dates.

DAY is common in billing and payroll: deciding which cycle a transaction falls in when the cutoff is the 20th, finding how many days a month has, or building the same day in other months. It returns only the day of the month, so the same day in different months gives the same number.

Arguments

serial_number
The date to take the day from: a cell with a date, the DATE function or the result of another date function.

DAY examples

  1. Example 1. Take the day from a date

    =DAY(A2)

    If A2 is 2026-05-04, the result is 4.

  2. Example 2. With DATE

    =DATE(YEAR(A2), MONTH(A2)+1, DAY(A2))

    Take the parts of A2 and add 1 to the month for the same day next month. If that day does not exist (as with January 31), it rolls into the following month; use EDATE for exactly one month later.

  3. Example 3. Billing cutoff on the 20th

    =IF(DAY(A2)<=20, "This cycle", "Next cycle")

    A transaction on or before the 20th goes into this month's cycle.

    A2=DAY(A2)Result
    2026-05-044This cycle
    2026-05-2020This cycle
    2026-05-2121Next cycle
  4. Example 4. Days in the month

    =DAY(EOMONTH(A2, 0))

    The day number of the month end is the number of days. February 2026 gives 28.

Common mistakes

FAQ

Can DAY take a text date?
Text Excel recognizes as a date, such as "2026-05-04", usually works, but it can depend on the computer's settings. A date cell or the DATE function is safer.
How do I get the day of the week?
Use WEEKDAY for a number, or TEXT(A2,"ddd") for the name.
How do I get the first of the month?
=DATE(YEAR(A2), MONTH(A2), 1), or =A2-DAY(A2)+1.
How do I show the day with two digits?
=TEXT(A2, "dd") returns text such as "04".