Use Of Datedif
FirstDate
|
SecondDate
|
Interval
|
Difference
| |||
01-Jan-60
|
10-May-70
|
days
|
3782
|
=DATEDIF(C4,D4,"d")
| ||
01-Jan-60
|
10-May-70
|
months
|
124
|
=DATEDIF(C5,D5,"m")
| ||
01-Jan-60
|
10-May-70
|
years
|
10
|
=DATEDIF(C6,D6,"y")
| ||
01-Jan-60
|
10-May-70
|
yeardays
|
130
|
=DATEDIF(C7,D7,"yd")
| ||
01-Jan-60
|
10-May-70
|
yearmonths
|
4
|
=DATEDIF(C8,D8,"ym")
| ||
01-Jan-60
|
10-May-70
|
monthdays
|
9
|
=DATEDIF(C9,D9,"md")
| ||
What Does It Do?
| ||||||
This function calculates the difference between two dates.
| ||||||
It can show the result in weeks, months or years.
| ||||||
Syntax
| ||||||
=DATEDIF(FirstDate,SecondDate,"Interval")
| ||||||
FirstDate : This is the earliest of the two dates.
| ||||||
SecondDate : This is the most recent of the two dates.
| ||||||
"Interval" : This indicates what you want to calculate.
| ||||||
These are the available intervals.
| ||||||
"d"
|
Days between the two dates.
| |||||
"m"
|
Months between the two dates.
| |||||
"y"
|
Years between the two dates.
| |||||
"yd"
|
Days between the dates, as if the dates were in the same year.
| |||||
"ym"
|
Months between the dates, as if the dates were in the same year.
| |||||
"md"
|
Days between the two dates, as if the dates were in the same month and year.
| |||||
Formatting
| ||||||
No special formatting is needed.
| ||||||
Birth date :
|
01-Jan-60
| |||||
Years lived :
|
57
|
=DATEDIF(C8,TODAY(),"y")
| ||||
and the months :
|
2
|
=DATEDIF(C8,TODAY(),"ym")
| ||||
and the days :
|
29
|
=DATEDIF(C8,TODAY(),"md")
| ||||
You can put this all together in one calculation, which creates a text version.
| ||||||
Age is 57 Years, 2 Months and 29 Days
| ||||||
="Age is "&DATEDIF(C8,TODAY(),"y")&" Years, "&DATEDIF(C8,TODAY(),"ym")&" Months and "&DATEDIF(C8,TODAY(),"md")&" Days"
|
कोई टिप्पणी नहीं:
एक टिप्पणी भेजें