DAYS Function in Microsoft Excel: Examples, Pitfalls & Compatibility
DAYS in Microsoft Excel: find an elapsed calendar-day difference with the end date supplied first. Includes worked examples and application-specific cautions.
Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in Microsoft Excel. How formula examples are checked
Quick answer: Use DAYS in Microsoft Excel to find an elapsed calendar-day difference with the end date supplied first. The official DAYS reference is the source for the function definition and platform-specific rules described below.
Syntax and arguments
=DAYS(end_date, start_date)
end_date (required): The date at the end of the interval; this is the first argument.
start_date (required): The date at the start of the interval; this is the second argument.
Examples use English function names, comma argument separators and decimal points. Adapt formula separators to your workbook settings, not punctuation inside quoted text.
When to use it
Use DAYS for elapsed calendar days, including weekends. Use NETWORKDAYS for a working-day rule. DAYS does not by itself count both endpoints as separate full days and is not the same function as DAY, which extracts a day-of-month number.
Three worked examples
Each example is independent. Where input cells are listed, enter those values first; otherwise the formula is self-contained. Expected outputs are independently checked calculations or documented error expectations, not captured results from Microsoft Excel.
Example 1: Count across a leap day
=DAYS(DATE(2024,3,1),DATE(2024,2,28))
Expected result: 2.
The interval includes February 29, so the elapsed difference is two days.
Example 2: Expose reversed argument order
=DAYS(DATE(2024,2,28),DATE(2024,3,1))
Expected result: -2.
Reversing the dates reverses the signed difference. This helps identify a swapped input column.
Example 3: Check a same-day interval
=DAYS(DATE(2026,10,12),DATE(2026,10,12))
Expected result: 0.
No calendar days elapse between the same date. An inclusive business rule would have to be applied separately.
Put it to work safely
Label the source columns Start and End, then write DAYS with End first even when Start appears first in the table. Check a same-day pair, a forward interval and a reversed interval. If the reporting policy counts both endpoints, apply that as a separately documented rule only after validating chronological order. A negative interval should usually be investigated before an inclusive-count adjustment.
Common mistakes and fixes
The sign is reversed. Check argument order. End date comes first. Do not apply ABS automatically if reversed dates would indicate a data problem.
A same-day interval returns zero. That is an elapsed-day result. An inclusive attendance or occupancy rule is a different calculation.
Weekends are included. DAYS is a calendar interval calculation, not a business-day count.
Dates imported as text are interpreted differently. Use validated date cells or DATE instead of ambiguous regional strings.
Microsoft Excel-specific notes
Microsoft states that numeric inputs use end minus start. Its documentation also distinguishes text-date parsing and notes that a text argument can lose its time component. For timestamp work, do not assume every input type is rounded to whole days in the same way. See the vendor reference for the current definition.
Excel and Google Sheets comparison
The ordinary DATE-based calendar intervals have the same intended meaning. Numeric timestamps, text parsing, inclusive-count policies and historical serial systems need separate checks. The independent calendar check here is not a native application test.
Compare the DAYS guide for Google Sheets and its official documentation. Having a guide in both libraries establishes two documented references, not a certificate of identical behavior across releases, locales or file conversions.
Related guides
Evidence and testing scope
Editorial verification: Official references retrieved on 2026-10-12. The three worked cases are included in this release’s reproducible Python checking suite. It checks the stated arithmetic, calendar or text model and the expected documented error classification; it is not the Microsoft Excel calculation engine. No native application run, UI screenshot, maximum-size benchmark or cross-version certification is claimed. Review the editorial testing standards before relying on a formula in a critical workbook.