Successfully reported this slideshow.
Upcoming SlideShare
×

# Excel DATEDIFF Function

24,299 views

Published on

This presentation is developed to impart understanding of Microsoft Excel's one of the most unique and powerful function DATEDIF. Which helps in calculating difference between dates.

• Full Name
Comment goes here.

Are you sure you want to Yes No
• Learn Excel from http://www.todaycourses.com

Are you sure you want to  Yes  No

### Excel DATEDIFF Function

1. 1. Working with Dates using Microsoft Excel & DateDif Function<br />
2. 2. Introduction to Excel Dates<br />Internally Microsoft Excel stores dates as numbers<br />You can perform simple addition & subtraction calculations using + & - operators<br />You can type dates either in the format of mm/dd/yyyy (if your regional settings is set to American date) or dd/mm/yyyy (if it is in British format)<br />But the safest way is to type ddmmmyy i.e. 10sep09 will automatically converted by excel to a date representing 10-Sep-09<br />
3. 3. Introduction to Excel Dates<br />To insert a date which automatically updates you can use a built in function:<br />=DATE()<br />If you want to enter a static current date you can also use the following shortcut key:<br />Ctrl + ;that is press control key hold it down and along with that press ; key<br />
4. 4. Calculating Difference in Days – Example 1<br />Suppose if I want to calculate my age in days i.e. how many days I have spent till my birth in this world and if today’s date is 07-Oct-09, I can use the minus operator to do that:<br />My date of birth<br />Today’s date<br />I can use – minus operator<br />This represents number of days I am alive<br />
5. 5. But what about difference in months & years!<br />
6. 6. Introduction to DATEDIF function<br />The answer to the question about month & year is DATEDIF<br />You can calculate difference of months & years between two dates by using DATEDIF<br />It’s one of the functions which is very rarely found in the Microsoft’s documentation for some good reasons<br />
7. 7. Syntax of DATEDIF<br />=DATEDIF(start_date, end_date, “interval” )<br />The function have 3 parameters<br />start_date: This is the date from which you want to calculate the difference this date should be an older date than the end_date.<br />end_date: This date is the date to which you want to calculate the difference, it should be higher than the start_date.<br />“interval”: As the syntax shows it should be included in “ … “ inverted commas, number of options in next slide.<br />7<br />
8. 8. “interval”<br />You can have any of the following values for the “interval” parameter:<br />“d”: This parameter is used if you want difference in days<br />“m”: This parameter is used if you want difference in months<br />“y”:This parameter is used if you want difference in years<br />“md”: This parameter is used if you want difference in days over months<br />“ym”: This parameter is used if you want difference in months over year<br />
9. 9. Calculating Difference of Months & Years – Example 2<br />d=Days<br />Functions<br />Results<br />m=Months<br />This says that I am 31 years 0 months & 23 days old<br />y=Years<br />ym=Monthsover Year<br />md=Daysover Month<br />
10. 10. Concatenating results / combining results – Example 3<br />Say we want that Excel should display all the result in one cell i.e. 31 years 0 months & 23 days I can get help from & ampersand operator<br />Text are enclosed in “ … “ inverted commas i.e. “I am “<br />DATEDIF function itself which will return the required values<br />To attach any text with formula value we put & ampersand sign outside the “ … “ inverted commas<br />
11. 11. Conclusion<br />Microsoft Excel treats dates as numbers<br />You can perform addition & subtraction operations on dates<br />When you type date it will convert the date as per the regional settings of your computer you can play safe by typing dates as mmdddyy10oct09<br />If you want to calculate difference of dates for the intervals of months or years or even days over months and months over year you have a function DATEDIF which you can use<br />Please comment if you like it, or have any<br />suggestions.<br />11<br />Photo Courtesy – www.freedigitalphotos.net<br />