The DAYS function is a simple date function that lets you calculate the number of days between two dates. The same result can arrived at by simply subtracting two dates such as: `="7/31/2016"-"6/5/1991"`.

Purpose

The DAYS function returns the number of days between two dates.

Related functions

DATEDIF - Calculate length of time between two dates in years, months, and/or days.

MINUS - Subtract one value from another. Can be done with dates.

Errors

#NUM - The inputs are numbers but are not valid dates. This could happen if you used the 35th day of November, "11/352018".

#VALUE! - The inputs are something that doesn't convert to a number such as "The other day" or "Yester-yester-day".

Syntax

`=DAYS(end_date,start_date)`

Note that, for some reason, the function wants the ending date first, then the starting date.

Examples

A few simple examples of the DAYS function.

 Formula Description Result `=DAYS("7/31/2017","7/31/2017")` Number of days between 7/31/2017 and 7/30/2016 366 `=DAYS("1/7/2020","12/5/2015")` Number of days between 12/5/2015 and 1/7/2020 1,494 `=DAYS(C3,"2/9/1994")` Number of days between 3/5/2001 (assuming that the value was in C3) and 2/9/1994 -2,581

Live examples in Sheets

Go to this spreadsheet for the examples of the DAYS function that you can study and use anywhere you would like.