Description
Use this function to return the count of days between two dates.
Syntax
DAYS("end_date","start_date")
Inputs
This function has the following arguments:
| Name | Required | Valid input |
|---|---|---|
end_date |
Yes | Last date of the range to be considered. This can be a cell reference, an integer date, or an explicit date in the format "DD/MM/YYYY" or "YYYY/MM/DD". A formula which results in one of these is also acceptable. Quotation marks are required for an explicit date. |
start_date |
Yes | First date of the range to be considered. This can be a cell reference, an integer date, or an explicit date in the format "DD/MM/YYYY" or "YYYY/MM/DD". A formula which results in one of these is also acceptable. Quotation marks are required for an explicit date. |
Examples
Sample data
| A | B | |
|---|---|---|
| 1 | Start date | End date |
| 2 | February 1, 2024 | 4/30/2024 |
| 3 | 5/31/2017 | April 23, 2019 |
| 4 | 1/7/2025 | 3/4/2025 |
Sample formulas
| Use case | Formula | Explanation and Result |
|---|---|---|
| Determine the number of days between the provided dates. | =DAYS("2021/03/04","2020/03/06") |
This formula calculates the number of days between For this data this formula returns: 363. |
| Determine the number of days between a date specified in a cell and the provided date. | =DAYS("01/12/2024",A2) |
This formula calculates the number of days between For this data this formula returns 1725. |
| Determine the duration of an event in days. | =IFERROR(SUM(DAYS(A2,B2)), "Bad Date") |
This formula works in the following manner:
For this data set this formula returns -89. |
| Calculate the number of non-working days between two dates. | =DAYS(B4, A4)-NETWORKDAYS(A4, B4) |
This formula works in the following manner:
For this data set this formula returns 15. |
Notes
- If an explicit date is used, it must be in quotation marks ("DD/MM/YYYY" or "YYYY/MM/DD").
- If two explicit dates are used, they must be in the same format ("DD/MM/YYYY" or "YYYY/MM/DD"), and both be in quotation marks.
- If either date isn't a valid integer date or in the format "DD/MM/YYYY" or "YYYY/MM/DD", DAYS returns the #VALUE! error.
- If
end_datepredatesstart_date, the value will be negative. - This is an absolute count of days.
Related functions
DATE
DATEVALUE
DAY
DAYS
DAYS360
EDATE
EOMONTH
MONTH
NETWORKDAYS
NETWORKDAYS.INTL
WEEKDAY
WORKDAY
WORKDAY.INTL
YEAR
YEARFRAC