Calculate Date Differences Easily Using Excel DAYS Function!

The function of the days in Excel returns the difference in days between two dates, ignoring the time!
Journal function: a brief
The days of the function in Excel are used to calculate the number of days between two dates. If you have a start date in cell A1 and a end date in cell B1the formula =DAYS(B1, A1)
will return the total number of days between these two dates.
If your system uses MM / DD / YY Date format but your formula uses a different format like DD / MM / YyyyExcel can show a #VALUE! error. It happens because the The date format in the formula does not correspond to the adjustment of the date of your systemWhich means that Excel has not read the date.
Objective |
Value returned by function |
---|---|
Aim to return days between two dates in number |
The function of the days extracted and will send the number of days between the end date and the start date. |
Day function: a syntax
=DAYS(end_date, start_date)
- end_date: The later date.
- Start date: The previous date.
Note: The result will be a positive or negative number depending on the order of the dates.
Compatibility of functions:
THE DAYS The function was introduced in Excel 2013. It is taken care of in all modern versions of Excel, including Excel 2013, 2016, 2019 and Microsoft 365. If you use old versions of Excel, you may need to use the formula: =DATEDIF(start_date, end_date, "d")
.
Basic example:
S.no |
End date |
Start date |
Final result |
Formula used |
Comments |
---|---|---|---|---|---|
1 |
March 12-24 |
01-Jan-24 |
71 |
= Days (B4, C4) |
Includes on February 29, so the year of jump is considered |
2 |
05-Jan-23 |
25-Dec-22 |
11 |
= Days (B5, C5) |
Days between December and January, different years |
3 |
June 19-21 |
01-août-21 |
-43 |
= Days (B6, C7) |
Reverse dates, returns a negative number |
4 |
03-COT-20 |
05-SEP-20 |
28 |
= Days (B8, C8) |
In 2020, a year of jump, but February not within reach |
5 |
08-May-23 |
01-Jan-23 |
127 |
= Days (B9, C9) |
Days between two dates of the same year |
6 |
June 30-22 |
June 15-22 |
15 |
= Days (B10, C10) |
Days between two dates in the same month and the year |
Of the example above,
- The 1st explains that the DAYS The function automatically checks if the data dates include a bissextile. If this is the case, it adds An additional day for the month of FEBRUARY.
- The 2nd shows that the DAYS The function can calculate the days difference Between the dates that fall different years.
- The 3rd explains that if the The end date is earlier that the start dateTHE DAYS The function will return a negative value.
- The 4th shows that even if a bissextile is present, the DAYS The function will be Ignore it if FEBRUARY East Not in the range dates.
- The 5th explains that the DAYS The function can find the difference between two dates in the same year.
- The 6th shows that the DAYS The function can also calculate the difference between two dates in the same month.
In the example above, I tried to cover all the necessary possibilities to use the function of days in Excel.
Use of other nested functions with the function of days:
In the example below, I listed the available combinations of use Days of days with other Excel functions.
Label |
Formula used |
To go out |
Explanation |
---|---|---|---|
Days between |
= Days (B7, B4) |
546 |
How many days from start to finish |
Remaining days |
= Days (B7, B10) |
-275 |
Days from today until the end |
Status (late) |
= If (days (B10, B7) <0, "late", "per hour") |
On time |
Check if the task is late |
Duration text |
= Text (days (B7, B4), “0”) and “days between the start and the end” |
546 days between the start and the end |
Respectful sentence of man showing the total days |
Subscription status |
= If (days (B10, B4)> 365, “expired”, “active”) |
Expired |
Asset or expired depending on 365 days check |
Months |
= Dadif (B4, B7, “M”) |
17 |
Calculate full months between the dates |
Fantasy |
= Dadif (B4, B7, “Y”) & “Years” and Dadif (B4, B7, “YM”) & “month”, & Dadif (B4, B7, “MD”) & “Days” |
1 year, 5 months, 29 days |
Shows months and leftover days |
That's it. This tutorial is initially published on the function of days How to use the days in Excel?