DAYS Function
DAYS Function
The DAYS function in Google Sheets returns the number of days (elapsed days or remaining days) between two dates as an integer. Use it when you want the pure calendar day difference regardless of weekends or holidays.
Syntax
=DAYS(end_date, start_date)
- end_date: The date representing the end of the period.
- start_date: The date representing the start of the period.
Note: Pay attention to the argument order, which is end_date followed by start_date (performing the same calculation as end_date - start_date).
Practical Examples with a Table
This example calculates the number of days in a contract period from its start and end dates.
| A (Contract Plan) | B (Start Date) | C (End Date) | D (Contract Days) | |
|---|---|---|---|---|
| 1 | Contract Plan | Start Date | End Date | Contract Days |
| 2 | Short-Term Trial | 2026/11/01 | 2026/11/15 | =DAYS(C2, B2) |
| 3 | Annual Plan | 2026/04/01 | 2027/03/31 | =DAYS(C3, B3) |
| 4 | Expiration Check | 2026/11/25 | 2026/11/20 | =DAYS(C4, B4) |
- Result in D2:
14(Nov 15 − Nov 1 = 14 days) - Result in D3:
364(Mar 31, 2027 − Apr 1, 2026 = 364 days) - Result in D4:
-5(Negative because the end date is 5 days earlier than the start date)
Common Errors and Precautions
- When
#VALUE!errors occur:- Occurs if an argument contains a text string that cannot be recognized as a date (e.g.,
"TBD"or"2026/13/01").
- Occurs if an argument contains a text string that cannot be recognized as a date (e.g.,
- When you want to include the first day in the count:
- Because
DAYScalculates the pure difference (subtraction), specifying Nov 1 to Nov 1 returns0. If you want the inclusive count of days (for example, 15 days for Nov 1 to Nov 15), add1like=DAYS(C2, B2) + 1.
- Because
- When time data is included:
- If a cell contains a date and time (e.g.,
2026/11/15 18:00), the fractional time is included in the calculation, but the decimal portion is truncated and an integer is returned.
- If a cell contains a date and time (e.g.,
Frequently Asked Questions
Q. Is there any difference between the DAYS function and simple subtraction (=end_date - start_date)?
A. The numerical result is the same, but the DAYS function explicitly defines the arguments in the order 'end_date, start_date', making the intent of calculating the number of days clearer in the formula.
Q. What happens if I reverse the order of start date and end date?
A. If the first argument (end_date) is an earlier date than the second argument (start_date), it does not produce an error and instead returns a negative number of days.