View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Glenn Glenn is offline
external usenet poster
 
Posts: 1,240
Default Add/Sum up months, years, dates

Delya wrote:
Hi,
I need to calculate work experience in years ,months, days. I did a formula
=DATEDIF(Q18;Q19;"y")&" years "&DATEDIF(Q18;Q19;"ym")&" months
"&DATEDIF(Q18;Q19;"md")& "days", where Q18 is 03.09.2007 and Q19 is
05.07.2008. I got a result 0 years 10 months and 2 days. I now want to add up
several such results in order to have total years , months and days, how can
i do it?




Assuming your dates are across rows 18 and 19, try this array formula (commit
with CTRL+SHIFT+ENTER):

=DATEDIF(,SUM(Q18:V18-Q19:V19),"y")&" years "&
DATEDIF(,SUM(Q18:V18-Q19:V19),"ym")&" months "&
DATEDIF(,SUM(Q18:V18-Q19:V19),"md")& " days"



If the dates are arranged alternating down the column, say Q18:Q29, it gets a
little more complex (still an array formula):


=DATEDIF(,SUM((Q18:Q29*((-MOD(ROW(Q18:Q29),2))+1))-
(Q18:Q29*MOD(ROW(Q18:Q29),2))),"y")&" years "&
DATEDIF(,SUM((Q18:Q29*((-MOD(ROW(Q18:Q29),2))+1))-
(Q18:Q29*MOD(ROW(Q18:Q29),2))),"ym")&" months "&
DATEDIF(,SUM((Q18:Q29*((-MOD(ROW(Q18:Q29),2))+1))-
(Q18:Q29*MOD(ROW(Q18:Q29),2))),"md")& " days"



If they are arranged some other way...