Return the number of days between two dates
=DAYS(end_date,start_date)
Return the number of days between two dates stored either as serial numbers (e.g. 44599 = 7th February, 2022), text values (e.g. "7-Feb-2022") or cell refences (e.g. C3).
DAYS syntax requires an end_date and a start_date. If the end date is earlier than the start date, the result is negative.
DAYS with numbers.
In the examples below, the DAYS function is used to calculate the number of days between two dates using serial numbers and cell references.
Use the DAYS function to return the number of days between two dates.

DAYS with text.
In the examples below, the DAYS function is used to calculate the number of days between two dates written as text strings.
Use the DAYS function to return the number of days between two dates.

Syntax
DAYS(end_date,start_date)
The DAYS function requires 2 arguments:
- end_date. Required. The end_date to which to calculate the number of days.
- start_date. Required. The start_date from which to calculate the number of days.
Try it now!
- Enter your formulas into the grey cells.
Scope
DAYS can calculate the number of days between 2 numeric or textual dates.
|
=DAYS(44599,44562) || result is 37 days where 44599 = 7-Feb-2022 and 44562 = 1-Jan-2022. |
|
=DAYS("7-Feb-2022","1-Jan-2022") || result is 37 days |
|
=DAYS(C7,C8) || result is 37 days where cell C7 contains the date 7-Feb-2022 and cell C8 the date 1-Jan-2022. |
Caveats
- If both date arguments are numbers: DAYS uses end_date – start_date to calculate the number of days in between both dates.
- If either one of the date arguments is text: text argument is treated as DATEVALUE(date_text) and returns an integer date instead of a time component.
- If date arguments are numeric values that fall outside the range of valid dates: DAYS returns the #NUM! error.
- If date arguments are strings that cannot be parsed as valid dates: DAYS returns the #VALUE! error.
- Only full days are counted. Fractional time values are ignored.
- Dates should ideally be entered using the DATE function. Working with textual dates is more complicated and may necessitate extracting year, month and day components from a text string using for example LEFT, RIGHT and MID functions.
Related Functions
- YEAR, MONTH, DAY returns the year, month or day from a date.
- HOUR, MINUTE, SECOND returns the year, month or day from a date.
- TODAY returns the current date.
- NOW returns the current date and time.
Functions Category