8. Excel How to calculate days between 2 dates ?


Excel stores dates as numbers. The number related to a date is called the Serial Number.

To calculate the number of days between two dates, simply write :

= end_date - start_date

Example

For example, the following extract:

Excel 2016 Difference between two dates

In cell C2 I simply wrote the formula :

= B2-A2

Small problem with this difference if one or both values are date-time, then the difference gives a value with decimal part :

Excel 2016 Difference between two dates

An alternative is to use the DAYS function.

DAYS Function

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

The DAYS function ignores the time and always returns an integer value.

Excel 2016 DAYS function

For information on how Excel handles Date Times and the Excel Date functions, see Date functions.


<< 7. Excel How to convert text to number ?

9. Excel How to count cells with text ? >>