MS Excel: DAY function to extract day numbers from dates
- Fakhriddinbek
- 3 days ago
- 2 min read
The DAY function in Excel is used to extract the day of the month from a given date. Whether you need to filter data by day, group records, or perform date-based analysis, the DAY function provides a simple way to isolate the numeric day (1–31) from a full date.

It’s especially helpful in time-based reporting, billing systems, and data cleaning tasks where day-level granularity is required.
Syntax
=DAY(serial_number)
Parameters:
Argument | Description |
serial_number | Required. A valid Excel date or a cell containing a date. |
Returns: An integer between 1 and 31, representing the day of the month.
Examples
Cell A2 (Date) | Formula | Result | Explanation |
2025-05-02 | =DAY(A2) | 2 | Extracts the day from the full date |
15/10/2024 | =DAY(A3) | 15 | Returns the 15th day |
=TODAY() | =DAY(TODAY()) | Varies | Gives today's day number dynamically |
"March 8, 2023" | =DAY("3/8/2023") | 8 | Works with text dates if recognized |
Excel stores dates as serial numbers; DAY will work on both actual dates and valid date serials.
Use Cases
Scenario | How DAY Helps |
Grouping by day in reports | Extract day numbers for pivot tables |
Calculating due dates or intervals | Subtract days between two dates |
Creating date-based conditions | Use with IF, IFS, SWITCH, etc. |
Validating data entry | Ensure correct day values entered |
Notes
If the input is not a valid date, Excel will return a #VALUE! error.
If you're working with text that looks like a date, ensure it's parsed correctly or use DATEVALUE() to convert it first.
Related Functions
Function | Description |
MONTH() | Returns the month number from a date (1–12) |
YEAR() | Returns the year from a date |
TODAY() | Returns the current date |
DATE() | Constructs a date from year, month, and day |
TEXT() | Can extract day using custom formatting "dd" |
Summary
Feature | Description |
Function Name | DAY |
Purpose | Extract the day portion of a date |
Result | Integer between 1 and 31 |
Argument Type | Valid date or date serial number |
Compatibility | All Excel versions |
Final Thoughts
The DAY function is one of Excel’s foundational date functions. It’s lightweight but powerful, particularly when paired with MONTH, YEAR, and conditional formulas for building dynamic, date-aware spreadsheets.
Comments