DATEDIF Worksheet Function : Age Calculation

.

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 i say Intervals, 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.
 
Syntax for the DATEDIF() Function:

=DATEDIF(StartDate, EndDate, Interval)
 
Where:
StartDate: is the First Date
EndDate: is the Second Date
Interval: This is the format or Type in which the difference you want
 

Note:

First Date should not be later than Second Date. If First Date is later than Second Date then the Formula will return an Error.
 
For 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
 

Interval Meaning Description
d Day Returns Total Number of Days between Two Dates
m Month Returns Total Number of Months between Two Dates
y year Returns Total Number of Years between Two Dates
yd Days Excluding Years Total Number of Days considering they are from the Same year.
ym Months Excluding Years Total Number of Months considering they are from the Same year.
md Number of Days Excluding Years and Month Total Number of Days considering they are from the Same Months and Same year.

 

Note:

1. 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.
 
=DATEDIF(StartDate,EndDate,”m”)

How to Calculate Age using this Function:

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.
 
=DATEDIF(A1,TODAY(),”y”)&” Years “&DATEDIF(A1,TODAY(),”ym”)&” Months and “&DATEDIF(A1,TODAY(),”md”)&” Days”

 

Buy a coffee for the author

Adsense

Download FREE Tools and Templates

There are many cool and useful excel tools and templates available to download for free. For most of the tools, you get the entire VBA code base too which you can look into it, play around it, and customize according to your need.

Convert PDF Tables to Excel with VBA | Step-by-Step Guide
Convert PDF Tables to Excel with VBA | Step-by-Step Guide

Convert PDF Tables to Excel with VBA | Step-by-Step Guide How to Convert PDF Tables to Excel Using Excel VBA (Macros) Extracting data from PDF tables into Excel can be tedious, but with Excel VBA (macros), you can automate this process and save time. This guide will...

Dynamic Arrays and Spill Functions in Excel: A Beginner’s Guide
Dynamic Arrays and Spill Functions in Excel: A Beginner’s Guide

In today's tutorial, we'll be diving into the exciting world of dynamic arrays and spill functions in Office 365 Excel. These features have revolutionized the way we work with data, providing a more flexible and efficient way to handle arrays. I am going to explain...

How to Declare a Public Variable in VBA
How to Declare a Public Variable in VBA

While programming in VBA sometimes you need to declare a Public Variable that can store the value throughout the program. Use of Public Variable: Let's say you have 4 different Functions in your VBA Code or Module and you have a variable that may or may not be...

What is Excel Formula?

Excel Formula is one of the best feature in Microsoft Excel, which makes Excel a very very rich application. There are so many useful built-in formulas available in Excel, which makes our work easier in Excel. For all the automated work, Excel Macro is not required. There are so many automated things can be done by using simple formulas in Excel. Formulas are simple text (With a Syntax) which is entered in to the Excel Worksheet Cells. So how computer will recognize whether it is a formula or simple text? Answer is simple.. every formula in Excel starts with Equal Sign (=).

You May Also Like…

0 Comments

Trackbacks/Pingbacks

  1. Calculate MOD of Large Numbers in Excel - Let's excel in Excel - […] DATEDIF WORKSHEET FUNCTION : AGE CALCULATION EXCEL UDF: TO EXTRACT ALL NUMBERS, SPECIAL CHARACTERS AND ALPHABETS FROM A STRING…

Submit a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Join and get a FREE! e-Book

Don't miss any articles, tools, tips and tricks, I publish here

You have Successfully Subscribed!

Pin It on Pinterest