DAY Function in Microsoft Excel: Formula, Examples & Troubleshooting
Learn the DAY formula in Microsoft Excel: extract the day of month from a date, with reproducible examples, expected answers and compatibility cautions.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: Use DAY to extract the day of month from a date. The example below supplies exact inputs and independently calculated expected results, so you can check your formula before replacing the demonstration values with real workbook data.
Verification: The function is covered by a vendor reference or its published formula catalogue. The worked outputs here are independently reasoned, not screenshots or native test results from Microsoft Excel. Check release-specific support and argument details in the referenced vendor help.
Availability and version history
- Introduced: Introduction version not established by the official history reviewed.
- Availability: Official help lists Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel 2024, Excel 2024 for Mac, Excel 2021, Excel 2021 for Mac, Excel 2019, Excel 2016.
- Checked: October 14, 2026; official DAY reference. Documentation check, not a new native test; existing example-verification notes retain their scope.
Syntax and arguments
=DAY(serial_number)
A valid date serial or date expression. In formula syntax, square brackets mark optional arguments; do not type square brackets into an ordinary formula unless the particular function requires array notation. The separator shown is for the example locale and might change with spreadsheet settings.
When to use it: DATE and EOMONTH help create unambiguous monthly boundaries.
Prepare the example inputs
Enter the self-contained DATE-based formulas in unused cells. Keep source dates as actual date values, and inspect the formula bar if the displayed answer differs. Display the extracted day result as General or a number; it is an integer component, not a date serial to format as a calendar date.
Worked example: exact formula and expected output
=DAY(DATE(2026,10,11))
Expected result: 11. The day component of October 11 is 11.
- Select an unused output cell (for example H2 if the practice table occupies A1:F9).
- Enter the formula exactly as shown, including the opening equals sign and quoted text.
- Compare the displayed answer to the expected result, then inspect the source cells if it differs.
For a range formula, the row numbers include data rows only unless the example explicitly refers to headers. A result that looks plausible may still be wrong if it references the wrong column.
Second example: a different input
=DAY(DATE(2024,2,29))
Expected result: 29. Leap-day date returns day 29.
This second check uses the same function with a different input, helping you identify whether the first result was coincidental or caused by a shifted reference.
DAY is an integer component, not a duration
Microsoft defines DAY as the Gregorian day-of-month from 1 through 31. Keep the output formatted as General or a number. A date format would reinterpret the extracted integer as a date serial and obscure the intended component.
The source explicitly says YEAR, MONTH and DAY return Gregorian components even if the input has a different calendar display. A localized display does not redefine the extracted value.
Example: cross a month boundary
=DAY(DATE(2026,10,31))
=DAY(DATE(2026,11,1))
Expected results are 31 and 1. Subtracting them as second minus first gives -30, although the two dates are only one day apart. For elapsed days between these date-only values, subtract the dates themselves:
=DATE(2026,11,1)-DATE(2026,10,31)
Expected numeric duration: 1 day. Label the output quantity so a day-of-month value is not mistaken for an elapsed count.
Advanced example: construct the first day of the same month
For A2 containing =DATE(2026,10,11):
=DATE(YEAR(A2),MONTH(A2),1)
Expected calendar date: 2026-10-01. For the date-only control, =A2-DAY(A2)+1 reaches the same date. The component-based construction makes the intended year and month explicit.
A timestamp can include a fractional day. The subtraction form can retain that fraction, so do not assume that every displayed first-of-month result is midnight. The explicit DATE construction is clearer for a date boundary.
Advanced example: count remaining dates in the month
With the same October 11 anchor:
=DAY(EOMONTH(A2,0))-DAY(A2)
=DAY(EOMONTH(A2,0))-DAY(A2)+1
Expected results are 20 and 21. The first counts dates after October 11 through October 31; the second includes the anchor date as well. Both are calendar-day counts, not workday or holiday-adjusted counts.
State whether the starting date is included before choosing a formula. A one-day discrepancy often comes from the question’s endpoint convention rather than a function error.
Advanced example: count days in a particular month
=DAY(EOMONTH(DATE(2024,2,4),0))
=DAY(EOMONTH(DATE(2026,2,4),0))
Expected results are 29 and 28. EOMONTH returns the month’s final date, and DAY extracts that date’s position, which equals the number of calendar days in the month.
A direct =DAY(DATE(2026,2,29)) instead gives 1, because DATE normalizes that invalid February entry to March 1. DAY extracts the normalized result; it does not validate the original input components.
Advanced check: reconstruct a complete date
With A5 containing =DATE(2024,2,29):
=DATE(YEAR(A5),MONTH(A5),DAY(A5))
Expected result: 2024-02-29. The individual components are 2024, 2 and 29. Keeping only DAY(A5)=29 loses the year and month and cannot uniquely identify the original date.
For a calendar report, group by the complete date or a clearly defined period key rather than by day-of-month alone. Every month can contain a day numbered one.
Common distinctions and error scope
WEEKDAY addresses position within a week; DAY does not. DAYS and ordinary subtraction answer date-difference questions rather than component extraction. These related operations have different argument and endpoint rules.
The selected Microsoft page does not provide a complete blank, text, Boolean or invalid-serial error matrix. Prefer explicit DATE expressions and inspect stored input types when a displayed date-like value gives an unexpected component. Native historical-date and cross-system conversions remain outside these modern controls.
Important edge cases and a common mistake
Watch out: DAY is day-of-month, not day-of-week; use WEEKDAY for weekday numbers.
If this formula needs to work in older Excel releases, consult the Microsoft version markers first; the function’s presence in a Microsoft 365 workbook does not establish Excel 2013 support.
Troubleshooting in Microsoft Excel
Microsoft documents Formulas → Evaluate Formula for Excel for Windows. If that command is unavailable in your client, put the component expressions in separate helper cells and compare their results; also check whether numeric-looking source values are stored as text. #NAME? suggests a misspelling or an unavailable new function. #VALUE! often indicates a wrong argument type; #SPILL! on array functions often means output cells are occupied.
If you get the wrong answer but no error, try these checks in order: (1) evaluate the simplified first example; (2) confirm the cell values and data types; (3) check the exact row and column boundaries; (4) verify quoted text, comparison operators and separators; (5) only then add more criteria or nested functions.
For a reproducible comparison with another spreadsheet product, use the same input values in both applications and record the installed version and locale. Different default matching behavior or handling of empty values can be a migration issue rather than a mathematical disagreement.
Moving this formula between spreadsheet programs
Excel generally uses commas in English-language help formulas; LibreOffice and Collabora Calc commonly use semicolons. An identically named function may still have different matching defaults, dynamic-array behavior or version support.
Related guides already published for this function: LibreOffice Calc | Apache OpenOffice Calc | Gnumeric | ONLYOFFICE Spreadsheet Editor | Apple Numbers
If a comparison tool says Not researched here, that means we do not yet have a checked guide for that software. It does not mean the software lacks this function. See the 12-program comparison tool for a guide-coverage matrix.
Official reference and editorial verification
Evidence level: Vendor-published function catalogue / formula overview, checked for this editorial batch on October 11, 2026; example outputs verified by direct reasoning/arithmetic where applicable. No execution in Microsoft Excel was performed. Some platform-, language- and release-specific edge cases remain for native testing.
October 14, 2026 review scope
The complete guide and all original formulas were reviewed against the direct Microsoft DAY reference. Added expectations use independently computed modern Gregorian calendars, explicit component rules and narrowly documented errors. The latest approved lifecycle section and Windows-specific troubleshooting scope are retained. No native Excel execution, historical serial certification or complete input-conversion matrix is claimed.