The formula came from pearson software consulting, at the time I posted it I could not remember where I got it from, or I would have gave him credit for it , it can be found at http://www.cpearson.com/excel/DateTimeWS.htm , I dont know precisely how it works but I think they are taking the year month and day out of the date, maybe somebody with more understanding of excel can answer it. Paul
Hamid (and Paul if you don't mind me adding to the discussion):
The "y" returns the number of complete years in the time period.
The "ym" represents the difference between the months in the start date and end date.
The "md" is the difference between the days in the start date and end date.
To complete the concept (you didn't ask but here it is anyway), a "yd" would represent the difference in days between start date and end date.
Also as you might guess, the "m" and "d" are for the number of complete months and days respectively.
Hope this helps.
Tom Urtis