Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default Totaling DATEDIF SUMS

I have two (A&B) columns with dates in each
I them have (C) with the formula =DATEDIF(A6,B6,"y") & " years, " &
DATEDIF(A6,B6,"ym") & " months, " & DATEDIF(A6,B6,"md") & " days"
I need to total column (C)
OR
I have also revised it so that (C) is =B1-A1 resulting in a number string
and then formatting the cell to read yy " years, " mm " months, " dd " days"
but I still can't get a total of all these years...............
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 287
Default Totaling DATEDIF SUMS

Hello kathi,

using =B1-A1 and formatting as yy " years, " mm " months, " dd " days" won't
give you the correct result, e.g. if B1-A1 =40 days that will (incorrectly)
give a result of 2 months and 9 days.

I'd stick with DATEDIF, then for a sum, assuming you have dates in rows 1 to
10, try

=DATEDIF(0,SUM(B1:B10)-SUM(A1:A10),"y")&" years,
"&DATEDIF(0,SUM(B1:B10)-SUM(A1:A10),"ym")&" months,
"&DATEDIF(0,SUM(B1:B10)-SUM(A1:A10),"md") & " days"



"kathi" wrote:

I have two (A&B) columns with dates in each
I them have (C) with the formula =DATEDIF(A6,B6,"y") & " years, " &
DATEDIF(A6,B6,"ym") & " months, " & DATEDIF(A6,B6,"md") & " days"
I need to total column (C)
OR
I have also revised it so that (C) is =B1-A1 resulting in a number string
and then formatting the cell to read yy " years, " mm " months, " dd " days"
but I still can't get a total of all these years...............

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Totaling DATEDIF SUMS

And the OP should be made aware that DATEDIF has a minor problem when the
start date is the end of January and the end date is the first of March. For
example, using the OP's formula...

=DATEDIF(A6,B6,"y") & " years, " & DATEDIF(A6,B6,"ym") &
" months, " & DATEDIF(A6,B6,"md") & " days"

she should try these combinations...

A6: 1/31/2007 or 1/30/2007
B6: 3/1/2007

or

A6: 1/31/2008
B6: 3/31/2008

Rick


"daddylonglegs" wrote in message
...
Hello kathi,

using =B1-A1 and formatting as yy " years, " mm " months, " dd " days"
won't
give you the correct result, e.g. if B1-A1 =40 days that will
(incorrectly)
give a result of 2 months and 9 days.

I'd stick with DATEDIF, then for a sum, assuming you have dates in rows 1
to
10, try

=DATEDIF(0,SUM(B1:B10)-SUM(A1:A10),"y")&" years,
"&DATEDIF(0,SUM(B1:B10)-SUM(A1:A10),"ym")&" months,
"&DATEDIF(0,SUM(B1:B10)-SUM(A1:A10),"md") & " days"



"kathi" wrote:

I have two (A&B) columns with dates in each
I them have (C) with the formula =DATEDIF(A6,B6,"y") & " years, " &
DATEDIF(A6,B6,"ym") & " months, " & DATEDIF(A6,B6,"md") & " days"
I need to total column (C)
OR
I have also revised it so that (C) is =B1-A1 resulting in a number
string
and then formatting the cell to read yy " years, " mm " months, " dd "
days"
but I still can't get a total of all these years...............


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Totaling DATEDIF SUMS

If you put the three DATEDIF functions in separate columns, one for
year, month and day (without the text labels), then you will find it
easier to total them, with appropriate carry forwards.

If you use =B1-A1 in C1 this will give you the number of days
difference, so you can total these easily and then split into years,
months and days. You might like to keep column C like this (you can
hide the column) and then format column D to give the display how you
have it now in C.

Hope this helps.

Pete

On May 17, 6:13*pm, kathi wrote:
I have two (A&B) columns with dates in each
I them have (C) with the formula =DATEDIF(A6,B6,"y") & " years, " &
DATEDIF(A6,B6,"ym") & " months, " & DATEDIF(A6,B6,"md") & " days"
I need to total column (C)
OR
I have also revised it so that (C) is =B1-A1 * resulting in a number string
and then formatting the cell to read yy " years, " mm " months, " dd " days"
but I still can't get a total of all these years...............


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 287
Default Totaling DATEDIF SUMS

That's a very good point, Rick.

This formula will give you very similar results to the 3xDATEDIF formula,
but without any negative numbers

=YEAR(B1)-YEAR(A1)-(TEXT(B1,"mmdd")< TEXT(A1,"mmdd"))&" years
"&MOD(MONTH(B1)-MONTH(A1)-(DAY(B1)< DAY(A1)),12)&" months
"&B1-MIN(DATE(YEAR(B1),MONTH(B1)-(DAY(B1)< DAY(A1))+{1,0},DAY(A1)*{0,1}))&"
days"

"Rick Rothstein (MVP - VB)" wrote:

And the OP should be made aware that DATEDIF has a minor problem when the
start date is the end of January and the end date is the first of March. For
example, using the OP's formula...

=DATEDIF(A6,B6,"y") & " years, " & DATEDIF(A6,B6,"ym") &
" months, " & DATEDIF(A6,B6,"md") & " days"

she should try these combinations...

A6: 1/31/2007 or 1/30/2007
B6: 3/1/2007

or

A6: 1/31/2008
B6: 3/31/2008

Rick


"daddylonglegs" wrote in message
...
Hello kathi,

using =B1-A1 and formatting as yy " years, " mm " months, " dd " days"
won't
give you the correct result, e.g. if B1-A1 =40 days that will
(incorrectly)
give a result of 2 months and 9 days.

I'd stick with DATEDIF, then for a sum, assuming you have dates in rows 1
to
10, try

=DATEDIF(0,SUM(B1:B10)-SUM(A1:A10),"y")&" years,
"&DATEDIF(0,SUM(B1:B10)-SUM(A1:A10),"ym")&" months,
"&DATEDIF(0,SUM(B1:B10)-SUM(A1:A10),"md") & " days"



"kathi" wrote:

I have two (A&B) columns with dates in each
I them have (C) with the formula =DATEDIF(A6,B6,"y") & " years, " &
DATEDIF(A6,B6,"ym") & " months, " & DATEDIF(A6,B6,"md") & " days"
I need to total column (C)
OR
I have also revised it so that (C) is =B1-A1 resulting in a number
string
and then formatting the cell to read yy " years, " mm " months, " dd "
days"
but I still can't get a total of all these years...............



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
DATEDIF Deborah Excel Worksheet Functions 11 September 12th 07 04:06 PM
How to add previous sums in a column to current sums in a column? TD Excel Worksheet Functions 1 September 30th 06 02:55 PM
DateDif ? nhvwchic Excel Worksheet Functions 3 August 24th 06 08:40 PM
DateDif Average? Damn DateDif UTCHELP Excel Worksheet Functions 14 November 17th 05 10:30 AM
datedif LWhite Excel Discussion (Misc queries) 1 February 16th 05 02:12 PM


All times are GMT +1. The time now is 10:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"