# DAYS Function – Google Sheets

The DAYS function is a simple date function that calculates the length of time between two dates. The same result can be arrived at by subtracting two dates: `="7/31/2016"-"6/5/1991"`. If the start and end dates are rervsed, the function returns a negative number.

Before reading the examples below, ensure you know how dates and times work as a large part of using date functions correctly is understanding what makes up a valid date. If you do not provide a valid date, the formula will error.

## Purpose

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

## Related functions

DATEDIF – Calculate the length of time between two dates. Use this for a more flexible alternative.

MINUS – Subtract one value from another. You can use this function with dates.

NETWORKDAYS – Calculates the number of workdays between two dates.

NETWORKDAYS.INTL – Calculates the number of workdays between two dates. NETWORKDAYS.INTL can exclude holidays if you provide them. This function is a more flexible version of NETWORKDAYS.

## Errors

#NUM – The inputs are numbers but are not valid dates. If you used the 35th day of November, “11/352018”, your dates would be invalid.

#VALUE! – The inputs don’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.