Thursday, January 8, 2009

MS Office Excel Date Difference

Last week a person in my office asked me how to find the difference between two dates in MS Office Excel (a typical question during year ending)i.e., in days, months and years. I like challenges and this one seemed like one, my programming skills kicked in and I was making all kind of ugly equations especially since I have hardly worked with Excel. Later a search in google revealed that MS Office Excel already had a function to solve this (what a waste of my time). Here it is for all you out there who are searching for this.

=DATEDIF(F11,G11,"y") & " years " & DATEDIF(F11,G11,"ym") & " months "&DATEDIF(F11,G11,"md")&" days" 


No comments: