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: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: DAYS subtracts a start date from an end date, with the end date first. Numeric timestamps can produce a fractional day. It measures elapsed calendar time, not an inclusive count of occupied dates or a working-day calendar.
Availability and version history
- Introduced: Microsoft marks this function as introduced in Excel 2013. Version-marker reference.
- 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 DAYS reference. Documentation check, not a new native test; existing example-verification notes retain their scope.
Syntax and input setup
=DAYS(end_date, start_date)
Examples use English function names and comma separators. Enter formula inputs exactly as shown, keep outputs outside the input cells, and use the specified date or numeric output format.
Both arguments are required. Use real numeric dates, conveniently created with DATE, and format the answer as General or Number. A date-formatted answer can disguise a perfectly valid numeric difference as an unrelated historical date.
Three original worked controls
=DAYS(DATE(2024,3,1),DATE(2024,2,28))
=DAYS(DATE(2024,2,28),DATE(2024,3,1))
=DAYS(DATE(2026,10,12),DATE(2026,10,12))
Expected results are 2, −2 and 0. February 2024 contains a leap day. Reversing the dates reverses the signed difference; equal dates have no elapsed interval. Do not apply ABS automatically if the negative sign identifies an incorrectly entered start or end.
Example: copy the calculation through a small report
Enter this independent A1:C5 table. The entries shown for A and B are formulas; C is the expected result of =DAYS(B2,A2) filled down.
| A · Start | B · End | C · Expected days |
|---|---|---|
=DATE(2026,6,1) |
=DATE(2026,6,5) |
4 |
=DATE(2026,6,5) |
=DATE(2026,6,8) |
3 |
=DATE(2026,6,8) |
=DATE(2026,6,8) |
0 |
=DATE(2026,6,9) |
=DATE(2026,6,8) |
-1 |
The Friday-to-Monday interval still contains three elapsed calendar days. DAYS does not remove Saturday and Sunday. Summing these four results gives 6, but summing unrelated intervals is meaningful only if that is the intended reporting measure.
Advanced example: preserve numeric time fractions
On a separate sheet put =DATE(2026,6,1)+9/24 in E2 and =DATE(2026,6,2)+18/24 in F2. These are numeric timestamps for June 1 at 09:00 and June 2 at 18:00.
=DAYS(F2,E2)
=DAYS(F2,E2)*24
=F2-E2
Expected results are 1.375 days, 33 hours and 1.375 days. Microsoft’s rule for two numeric arguments is ordinary end-minus-start subtraction. Formatting the first result with no decimal places could hide the fraction without changing it.
Changing F2 to =DATE(2026,6,1)+18/24 gives 0.375 days, or 9 hours. Reversing the original timestamps gives −1.375. DAYS is not a command to truncate every timestamp to its calendar date.
Numeric dates and text dates follow different paths
Microsoft documents that a text argument is processed as DATEVALUE and contributes an integer date without its time component. A numeric timestamp retains its fractional part. Consequently, replacing a numeric timestamp with visually similar text can change the result.
No locale-dependent timestamp string is assigned a universal result here. Parse imported strings deliberately and verify their numeric type before comparing intervals. Changing a cell’s number format does not by itself establish that a text entry became a numeric date.
Advanced example: apply an explicit inclusive-date policy
If a report counts both calendar endpoints, first require ordered, date-only inputs. With A2 June 1 and B2 June 5:
=IF(B2<A2,"Check dates",DAYS(B2,A2)+1)
Expected result: 5. Equal date-only inputs give 1; June 9 followed by June 8 produces Check dates. The added one expresses this report’s policy, not the meaning of DAYS itself.
Do not reuse that rule unmodified for the 33-hour timestamp example, hotel-night counts, or working-day attendance. Those are different measures. NETWORKDAYS applies a working calendar, while DAYS always includes elapsed weekends.
DAYS is different from DAY
For March 1, 2024 minus February 28, 2024, subtracting the day-of-month components gives 1-28, or −27. The original DAYS formula correctly gives 2. DAY extracts a component; it cannot preserve the month and year needed for an elapsed interval.
Likewise, DAYS does not calculate completed anniversaries. DATEDIF documents complete-year and complete-month units with its own limitations.
Documented errors and boundaries
Microsoft assigns #NUM! to numeric date arguments outside the valid date range and #VALUE! to strings that cannot be interpreted as valid dates. This guide does not expand that into an untested table for every Boolean, blank, error or regional text input.
Keep timestamps in the same intended date system and time basis. The subtraction itself does not reconcile different workbook serial systems or convert between time zones. No historic-1900 boundary or daylight-saving elapsed-hour guarantee is inferred from the modern date controls above.
Related guides and verification
DAYS guide for Google Sheets | DATE | DAY | NETWORKDAYS | DATEDIF | All Microsoft Excel functions | editorial testing standards
The full manuscript and original worked formulas were reviewed on October 14, 2026. The approved availability/history section is unchanged. Expected results are independently calculated date/arithmetic models or explicitly documented rules, not native Excel output. Current-clock formulas have conditional rather than fixed outputs. Client-specific time-zone, mixed-type and boundary behavior is not inferred from another spreadsheet.