Time Within Two Dates
Time Within Two Dates
The amount of time between two given times is known as time interval. In other words, it is the
amount of time that has passed between the beginning and end of the event.
An interval between two events or dates is the period of time between them. There was a long
interval of silence.
The equivalent of the formula shown in cell E5 above would be = DAYS ($C$2, D6)/365 which would give
similar results.
Take a look.
Notice that in this case you start by specifying the date of joining in the formula.
This function computes the difference in either the completed/full years, months or days, between two dates.
Just like the YEARFRAC function, it also requires you to specify the starting and the ending date. However,
you would need to specify the time unit of output, in terms of years, months or days.
There are six different outputs that you can get based on the time unit you specify as follows:[/vc_column_text]
[gem_table]
Uni
Output
t
“y” Difference in terms of complete years
“m” Difference in terms of complete months
“d” Difference in terms of complete days
Uni
Output
t
Returns the difference of complete days, ignoring the ones in the years that have been completed. Simply
“yd” put, for the specified start date, it takes the equivalent date in the immediate previous year as the basis of
subtracting the completed days
Returns the difference of complete months, ignoring the ones in the years that have been completed. It
“ym”
takes the immediate previous year as the basis of subtracting the full months
This interval just subtracts the day part of the two dates. For instance, in the table below, notice the “md”
“md”
column is the difference between the day element of the two dates. In row 9 for example it is 31-1=30
The figure below illustrates all the six possible outputs.
In conclusion
The various approaches discussed above are enough arsenals for various scenarios you may encounter.
Should you have comments or questions regarding manipulating dates in Excel, please lodge them in the
comments area below.
Please share the article with your colleagues and let them improve how they work with Excel.