Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default convert # of years, months and days

Hi again! It just got slightly more complicated (or at least for me). Here is
an example to get the problem more clear: Mister X worked for a couple of
periods in our company:
start date end date years months days
19.12.2003 13.09.2005 1 8 25
09.10.2005 01.11.2006 1 0 23
09.11.2006 20.01.2008 1 2 11
total 3 10 59
As we see it the ex the # of days corresponds to more than a month. The
question is: how do I convert if it is necessary the # of days in months,
months years, taking into consideration that a month could be 28, 29, 30
and 31 days long.
Thanks very much in advance.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default convert # of years, months and days

Why not just work in days - there is no ambiguity there !

If you take it that there are 365.25 days in a year on average, then
dividing this by 12 will give you 30.4375 as an average number of days
in a month.

If you make use of the DATEDIF function, I'm not sure what algorithm
it uses.

Hope this helps.

Pete

On Feb 1, 12:50*pm, catrrmg wrote:
Hi again! It just got slightly more complicated (or at least for me). Here is
an example to get the problem more clear: Mister X worked for a couple of
periods in our company:
start date * * * * * * * * * * * *end date * * * * * * * * * * *years * months *days
19.12.2003 * * *13.09.2005 * * *1 * * * 8 * * * 25
09.10.2005 * * *01.11.2006 * * *1 * * * 0 * * * 23
09.11.2006 * * *20.01.2008 * * *1 * * * 2 * * * 11
total * * * * * * * * * * * * * * * * * * * * * 3 * * * 10 * * *59
As we see it the ex the # of days corresponds to more than a month. The
question is: how do I convert if it is necessary the # of days in months,
months years, taking into consideration that a month could be 28, 29, 30
and 31 days long.
Thanks very much in advance.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default convert # of years, months and days

That is the problem: mathematic functions don't work for me in this case. I'd
like to get the exact result: X years X months X days based on the provided
information.

"Pete_UK" wrote:

Why not just work in days - there is no ambiguity there !

If you take it that there are 365.25 days in a year on average, then
dividing this by 12 will give you 30.4375 as an average number of days
in a month.

If you make use of the DATEDIF function, I'm not sure what algorithm
it uses.

Hope this helps.

Pete

On Feb 1, 12:50 pm, catrrmg wrote:
Hi again! It just got slightly more complicated (or at least for me). Here is
an example to get the problem more clear: Mister X worked for a couple of
periods in our company:
start date end date years months days
19.12.2003 13.09.2005 1 8 25
09.10.2005 01.11.2006 1 0 23
09.11.2006 20.01.2008 1 2 11
total 3 10 59
As we see it the ex the # of days corresponds to more than a month. The
question is: how do I convert if it is necessary the # of days in months,
months years, taking into consideration that a month could be 28, 29, 30
and 31 days long.
Thanks very much in advance.



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default convert # of years, months and days

On Fri, 1 Feb 2008 04:50:00 -0800, catrrmg
wrote:

Hi again! It just got slightly more complicated (or at least for me). Here is
an example to get the problem more clear: Mister X worked for a couple of
periods in our company:
start date end date years months days
19.12.2003 13.09.2005 1 8 25
09.10.2005 01.11.2006 1 0 23
09.11.2006 20.01.2008 1 2 11
total 3 10 59
As we see it the ex the # of days corresponds to more than a month. The
question is: how do I convert if it is necessary the # of days in months,
months years, taking into consideration that a month could be 28, 29, 30
and 31 days long.
Thanks very much in advance.


The short answer is that you can't, without adopting some kind of convention.
Don't forget that years can also be 365 or 366 days.

The simplest, in my opinion, would be to convert to days, or to weeks and days.

If start_date and end_date are named ranges, then

The days between any two dates is simply:

=end_date-start_date (and format as General or Number with 0 decimal places)

The total dates worked would be given by the **array** formula (enter with
<ctrl<shift<enter )

=SUM(end_date-start_date)

Other solutions could be to use the DAYS360 method, which assumes that all
months have 30 days. People will be upset because all of their "days" will not
count.

Or you could count calendar months + residual days, and ignore the fact that
the residual days are more than 30.
--ron
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 33
Default convert # of years, months and days

I don't know how you can differentiate between 28-31 day months, since you're
adding periods that have various beginning and ending months. Here's what
you could try using the given information, and assuming an average
30.4375-day month:

total years = SUM(C2:C4)+FLOOR(SUM(D2:D4)/12,1)
[adds a year for every 12 months in column D]

total months =
SUM(D2:D4)-FLOOR(SUM(D2:D4)/12,1)*12+FLOOR(SUM(E2:E4)/30.4375,1)
[removes months that are accounted for in column C, adds a month for every
30.4375 days in column E]

total days = SUM(E2:E4)-FLOOR(SUM(E2:E4)/30.4375,1)*30.4375
[removes days that are accounted for in column D]

"catrrmg" wrote:

Hi again! It just got slightly more complicated (or at least for me). Here is
an example to get the problem more clear: Mister X worked for a couple of
periods in our company:
start date end date years months days
19.12.2003 13.09.2005 1 8 25
09.10.2005 01.11.2006 1 0 23
09.11.2006 20.01.2008 1 2 11
total 3 10 59
As we see it the ex the # of days corresponds to more than a month. The
question is: how do I convert if it is necessary the # of days in months,
months years, taking into consideration that a month could be 28, 29, 30
and 31 days long.
Thanks very much in advance.

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
convert number of days into years/months eileenmole Excel Discussion (Misc queries) 2 April 17th 23 07:00 PM
how do i convert a number of days to years, months & days? SafetyLen Excel Discussion (Misc queries) 1 August 23rd 07 01:34 AM
How do I convert a number into Years, Months, Days format? K. Krishna Murthi Excel Worksheet Functions 6 December 24th 06 02:29 PM
how to convert 12/10/1970 to years/months/days doctor who golf New Users to Excel 3 October 31st 06 12:12 AM
convert Days to Years, Months, Days Klaudebou Excel Discussion (Misc queries) 3 December 29th 05 11:33 PM


All times are GMT +1. The time now is 08:31 PM.

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

About Us

"It's about Microsoft Excel"