MS Excel: DAYS function to calculate days between two dates
- Fakhriddinbek
- 3 days ago
- 2 min read
The DAYS function in Excel allows you to calculate the number of days between two dates. This is useful for tasks like calculating age in days, determining time remaining until deadlines, measuring project durations, or analyzing the difference between start and end dates.

Compared to manual subtraction (=EndDate - StartDate), the DAYS function provides clearer intent and better error handling when working with date values.
Syntax
=DAYS(end_date, start_date)
Parameters:
Argument | Description |
end_date | Required. The later date in the range. |
start_date | Required. The earlier date in the range. |
Returns: An integer representing the number of days between the two dates.
Examples
Formula | Result | Explanation |
=DAYS("2025-12-31", "2025-01-01") | 364 | Days between Jan 1 and Dec 31, 2025 |
=DAYS(A2, A1) | Varies | Assumes A2 has end date, A1 has start date |
=DAYS(TODAY(), "2024-01-01") | Varies | Days since Jan 1, 2024 to today |
=DAYS("2023-01-01", "2025-01-01") | -730 | Negative result if start date is later |
The result can be positive or negative depending on the order of dates.
Use Cases
Scenario | How DAYS Helps |
Project tracking | Measure time elapsed or time remaining |
Financial modeling | Calculate interest period in days |
HR applications | Track days between hire and exit dates |
Deadline calculations | Count days until due dates |
Date validation | Ensure required lead times are met |
Notes
Both end_date and start_date must be valid date values or cell references containing dates.
If non-date values are used, DAYS may return a #VALUE! error.
DAYS was introduced in Excel 2013. In older versions, use =end_date - start_date.
Related Functions
Function | Description |
DATEDIF() | Returns difference in days, months, or years |
NETWORKDAYS() | Returns number of working days between two dates |
TODAY() | Returns the current date |
NOW() | Returns the current date and time |
EDATE() | Adds or subtracts months from a date |
Summary
Feature | Description |
Function Name | DAYS |
Purpose | Calculate number of days between two dates |
Return Type | Integer (positive or negative) |
Introduced In | Excel 2013+ |
Requires Dates | Yes – valid Excel date values |
Final Thoughts
The DAYS function simplifies date arithmetic in Excel by making your formulas easier to read and maintain, especially when working with dynamic date inputs. Whether you're scheduling, reporting, or forecasting, DAYS is a key component of time-sensitive calculations.
Comments