{"id":12126,"date":"2012-02-10T17:41:40","date_gmt":"2012-02-10T17:41:40","guid":{"rendered":"http:\/\/www.learnexcelmacro.com\/?p=1324"},"modified":"2012-02-10T17:41:40","modified_gmt":"2012-02-10T17:41:40","slug":"datedif-function-age-calculation","status":"publish","type":"post","link":"https:\/\/vmlogger.com\/excel\/2012\/02\/datedif-function-age-calculation\/","title":{"rendered":"DATEDIF Worksheet Function : Age Calculation"},"content":{"rendered":"
In this Article, I am going to explain you, how can you use DATEDIF()<\/strong> Function and also using this, how can you calculate Age in Excel. Basically DATEDIF<\/strong> calculates difference between two dates. The most interesting part of this Function is that you can calculate the difference between two dates by a given intervals. If i say Intervals<\/strong>, what does it mean? Interval means, In what interval do you actually want the difference between two dates like total difference in Months, or Years or Days etc. =DATEDIF(StartDate, EndDate, Interval) <\/span> First Date should not be later than Second Date. If First Date is later than Second Date then the Formula will return an Error. <\/strong><\/p>\n <\/p>\n 1.<\/strong> If you are giving Dates and Interval Directly in your Formula then they both must be passed in DOUBLE QUOTES (“”) otherwise you can pass the reference directly. Using this Function we can calculate Age of Some One just by Passing his\/her Birth date. In A1 Cell the Date of Birth is Kept. Considering that you can use the following Formula. <\/p>\n<\/span>","protected":false},"excerpt":{"rendered":" In this Article, I am going to explain you, how can you use DATEDIF() Function and also using this, how can you calculate Age in Excel. Basically DATEDIF calculates difference between two dates. The most interesting part of this Function is that you can calculate the difference between two dates by a given intervals. If […]<\/p>\n","protected":false},"author":45,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[1672],"tags":[],"class_list":["post-12126","post","type-post","status-publish","format-standard","hentry","category-excel-formula"],"yoast_head":"\n
\n<\/p>\n
\n
\nSyntax for the DATEDIF() Function:<\/strong><\/p>\n
\n
\nWhere:
\nStartDate:<\/strong> is the First Date
\nEndDate:<\/strong> is the Second Date
\nInterval:<\/strong> This is the format or Type in which the difference you want
\n <\/p>\nNote:<\/h3>\n
\n
\nFor Interval, we have few predefined Syntax, which you can use any one of them. Below is the list and Description for each of the Intervals<\/strong>
\n <\/p>\n\n\n<\/p>\n
\n Interval<\/span><\/td>\n Meaning<\/span><\/td>\n Description<\/span><\/td>\n<\/tr>\n \n d<\/td>\n Day<\/td>\n Returns Total Number of Days between Two Dates<\/td>\n<\/tr>\n \n m<\/td>\n Month<\/td>\n Returns Total Number of Months between Two Dates<\/td>\n<\/tr>\n \n y<\/td>\n year<\/td>\n Returns Total Number of Years between Two Dates<\/td>\n<\/tr>\n \n yd<\/td>\n Days Excluding Years<\/td>\n Total Number of Days considering they are from the Same year.<\/td>\n<\/tr>\n \n ym<\/td>\n Months Excluding Years<\/td>\n Total Number of Months considering they are from the Same year.<\/td>\n<\/tr>\n \n md<\/td>\n Number of Days Excluding Years and Month<\/td>\n Total Number of Days considering they are from the Same Months and Same year.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n Note:<\/h3>\n
\n
\n=DATEDIF(StartDate,EndDate,”m”)<\/span>
\n<\/p>\nHow to Calculate Age using this Function:<\/h3>\n
\n
\n=DATEDIF(A1,TODAY(),”y”)&” Years “&DATEDIF(A1,TODAY(),”ym”)&” Months and “&DATEDIF(A1,TODAY(),”md”)&” Days”<\/span><\/p>\n