The DAYS function in Google Sheets is a powerful tool that allows users to easily calculate the number of days separating two dates. This function is particularly useful for tracking deadlines, calculating durations, and managing schedules in various accurate contexts.
Syntax
DAYS(end_date, start_date)
- end_date: This is the later date in the comparison. It represents the date you want to calculate to.
- start_date: This is the earlier date. It signifies the date from which you want to calculate the difference.
Example #1
=DAYS("2023-10-15", "2023-10-01")
This function call calculates the number of days from October 1, 2023, to October 15, 2023. The result would be 14 days.
Example #2
=DAYS("2023-12-31", "2023-01-01")
In this example, the function computes the total number of days between January 1, 2023, and December 31, 2023. The result will return 364 days.
Example #3
=DAYS(A1, A2)
Assuming cell A1 contains the date “2023-05-20” and cell A2 contains “2023-05-15”, this function will calculate the days between these two dates, yielding a result of 5 days.
Error handling
- VALUE! This error occurs when one or both of the arguments are not valid date formats.
- NUM! This error indicates that the calculated difference between the dates is too large or the dates are out of the acceptable range.