Purpose

Return value

Syntax

=DAYS(end_date,start_date)
  • end_date - The end date.
  • start_date - The start date.

Using the DAYS function

The DAYS function returns the number of days between two dates. Both dates must be valid Excel dates or text values that can be coerced to dates. The DAYS function only works with whole numbers, fractional time values that might be part of a date are ignored. If start and end dates are reversed, DAYS returns a negative number. The DAYS function returns all days between two dates, to calculate working days between dates, see the NETWORKDAYS function .

Examples

With a start date in A1 and end date in A2:

=DAYS(A2,A1)

Will return the same result as:

=A2-A1

Unlike the simple formula above, the DAYS function can also handle dates in text format, as long as the date is recognized by Excel. For example:

=DAYS("7/15/2016","7/1/2016") // returns 14

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

=DAYS("1-Mar-21","2-Mar-21") // returns 1

To include the end date in the count, add 1 to the result:

=DAYS("1-Mar-21","2-Mar-21")+1 // returns 2

Storing and parsing text values that represent dates should be avoided, because it can introduce errors and parsing problems. Working with native Excel dates (which are numbers) is a better approach. To create a numeric date from scratch in a formula, use the DATE function .

Notes

  • The DAYS function only works with whole numbers and ignores time.
  • If dates are not recognized, DAYS returns the #VALUE! error.
  • If dates are out of range, DAYS returns the #NUM! error.

Purpose

Return value

Syntax

=DAYS360(start_date,end_date,[method])
  • start_date - The start date.
  • end_date - The end date.
  • method - [optional] Day count method. FALSE (default) = US method, TRUE = European method.

Using the DAYS360 function

The DAYS360 function returns the number of days between two dates, based on a year where all months have 30 days. Both dates must be valid Excel dates or text values that can be parsed as dates. The DAYS360 function only works with whole numbers, time values are ignored.

Method

DAYS360 takes an optional argument called method that can be set to either TRUE or FALSE. When method is FALSE (default) DAYS360 uses a US method to compute days. When the start date is the last day of the month, it is treated like the 30th day of that month. When the end date is the last day of the month, and the start date is less than 30, the end date is treated as the 1st of the next month, otherwise the end date is treated like the 30th of the same month.

If method is set to TRUE, DAYS360 uses a European method to calculate days. In this scheme, start and end dates equal to the 31st of a month are set to the 30th of the same month.

Examples

In the formula below, DAYS360 returns 360 days with a start date of January 1, 2021 and an end date of December 31, 2021.

=DAYS360("1-Jan-2021","31-Dec-2021") // returns 360

The result of 360 is based on 12 months * 30 days in each month.

Note: In general, storing and parsing text values that represent dates is bad form and should be avoided, because it can introduce errors and parsing problems. Working with native Excel dates is a better approach.

With a start date of July 1, 2021 in A1, and an end date of December 31, 2021 in B1, the formula below returns 180:

=DAYS360(A1,B1) // returns 180

To create a date from scratch in a formula, use the DATE function . The formula below returns 90:

=DAYS360(DATE(2021,1,1),DATE(2021,4,1)) // returns 90

Notes

  • The DAYS360 function only works with whole numbers and ignores time.
  • If dates are not recognized, DAYS360 returns the #VALUE! error.
  • If dates are out of range, DAYS360 returns the #NUM! error.