How to subtract Dates in Microsoft Excel

Excel 2007 Excel 2003 Macros Excel 2007 Macros Excel 2003 Excel 2010




How to subtract dates in Microsoft Excel.?
I am using Microsoft Execl 2007 and want to calculate the total years, months and days a person worked from his date of joining till his date of leaving.
Example:
Date of Joining: mm-dd-yyyy
Date of Leaving:- mm-dd-yyyy
I want the output in the result cell to be 'X years, Y Months and Z days'.
You can subtract two dates in Microsoft Excel using the DATEDIF() function:
DATEDIF(DATE1,DATE2,Unit)
DATE1 = Start Date
DATE2 = End Date
Unit to be enclosed in quotes:
"m" - complete calendar months between the 2 dates
"d" - number of days between the 2 dates
"y" = complete number of years bewteen the 2 dates
"ym" = complete calendar months between the 2 dates assuming the months are in the same year
"yd" = complete calendar days between the 2 dates assuming they are in the same year
"md" = complete calendar days between the dates assuming they were in the same month and same year.
You can combine the 'datedif()' function andt the 'today()' function to calculate the age orf a person.
Note: Use this function with caution since it sometimes gives erratic results particularly in the "md" calculations.
Watch the video to see learn how the MS Excel solution is implemented:








More Tips (Solutions):
How do I view and edit Microsoft Excel files on an iPad?
Inventory Soluton
How to rename and color worksheet tabs
Copy Worksheet Quickly
Criteria Range
Animations in Microsoft Excel
Create two charts at once
How to avoid errors while working in Excel
How to benefit from Microsoft Excel Templates
How to use Microsoft Excel 2007 with Word 2007 - create mail merge labels
Landscape Oriented Worksheet Template
How to-make a worksheet fit a printed page
How to make your charts more impressive
Perpetual Calendar from 1900 to 9999
How to create your own custom add-in
How to clear  conditional formattng  in Excel worksheets
How to speed up data entry of decimal numbers
How to change the color of the gridlines of an Excel worksheet or hide them
How to use Autosum in Multiple Worksheet Cells Quickly
How to have your free personal assistant in Mcrosoft Excel who reads out the data to you
How to use the status bar in Microsoft Excel to do a quick data analysis
How to calculate equal monthly payments or instalments using a mathematical equation
Data Forms to Enter and Edit Data
View 2 worksheets in same workbook side by side
Accessing a specific worksheet in large workbooks with multiple worksheets
Referencing a cell in another worksheet
How to perform a what-if analysis using a scrollbar form control
An interesting payroll solution
Future Value Solution in Microsoft Excel
Another Interesting Conditional Formatting Solution
DSUM and Array Formulas for addition solutions
IF Function Question
How to use command buttons on a splash screen in MS-Excel
Copy Paste Data from one Excel Worksheet to Another
How to separate comma separated values (csv) in a worksheet cell in Microsoft Excel into rows or columns
Another Interesting Solver solution in Microsoft Excel
Find duplicates in two different Excel worksheets using a macro
How to count data based on multiple criteria - countifs function
How to convert 6/5/2011 into Sunday, 6/5/2011
User Form to perform calculations
An interesting solution using conditional formatting in Microsoft Excel 2007
Show/Hide Controls on a User-Form using a Checkbox
Populate Listbox and Textboxes with Excel data using VBA and Vlookup
Protecting Specific Worksheets in an Excel Workbook using VBA
How to calculate the difference in hours between two date-time values
How do I match data from 2 worksheets and highlight the differences using MS-Excel VBA?
How to focus on a specific control (TextBox1) on a user-form in MS-Excel
Interesting sumproduct solution
COMPARE DATA LISTS USING VLOOKUP AND ISNA FUNCTIONS
VLOOKUP SOLUTION USING LIST IN MS EXCEL
How to generate random numbers in MS Excel
Lottery game in Microsoft Excel
Nested If Function to Determine Project Complexity
Power Billing Solution in Microsoft Excel
Solver Excel - An easy to understand example
Another Interest Calculation Solution
Interesting Microsoft Excel Formula Based on Date and Row Functions

Excel 2007 Excel 2003 Macros Excel 2007 Macros Excel 2003 Excel 2010