#1   Report Post  
Posted to microsoft.public.excel.misc
Ken Ken is offline
external usenet poster
 
Posts: 590
Default DATEDIF?

Excel2003 ...

I need to determine fractional MONTHS between 2 Dates to 1 decimal place
(17.3 months). DATEDIF is returning whole number of months which I cannot
seem to format to 1 decimal place.

How can you help me? ... Thanks ... Kha
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default DATEDIF?

Fractional months is a difficult concept to grasp when you consider that a
month is not a uniform unit of measure. A month can have from 28 to 31 days.

--
Biff
Microsoft Excel MVP


"Ken" wrote in message
...
Excel2003 ...

I need to determine fractional MONTHS between 2 Dates to 1 decimal place
(17.3 months). DATEDIF is returning whole number of months which I cannot
seem to format to 1 decimal place.

How can you help me? ... Thanks ... Kha



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7,247
Default DATEDIF?

You can use a formula like

=DATEDIF(A1,B1,"m")+(B1-DATE(YEAR(B1),MONTH(B1),1))/DAY(DATE(YEAR(B1),MONTH(B1)+1,0))

where the start date is in A1 and the end date is in B1. The integer
portion of the result is the number of whole months between the two
dates. The fractional portion is the day of the end date divided by
the number of days in the end month. The same day of month for
different months will return different values, since a month can have
anywhere from 28 to 31 days. The whole idea of a "fraction of a month"
is a bit slippery and open to interpretation.

For example, if the end date is the 20th of the month, the fractional
portion will be 0.61 if the month has 31 days, 0.68 if the month has
28 days, and 0.63 if the month has 30 days. Take you pick as to which
is the "correct" answer.



Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



On Wed, 18 Mar 2009 13:36:52 -0700, Ken
wrote:

Excel2003 ...

I need to determine fractional MONTHS between 2 Dates to 1 decimal place
(17.3 months). DATEDIF is returning whole number of months which I cannot
seem to format to 1 decimal place.

How can you help me? ... Thanks ... Kha

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 143
Default DATEDIF?

I need to determine fractional MONTHS between 2 Dates to 1 decimal
place (17.3 months).


Fractional months is a difficult concept to grasp when you consider
that a month is not a uniform unit of measure. A month can have from
28 to 31 days.


True, but on the average there are 365.25/12 days in a month. If that's
close enough for the OP, then something like
=(A2-A1)/(365.25/12)
might satisfy the need. Format the result as a number.
  #5   Report Post  
Posted to microsoft.public.excel.misc
Ken Ken is offline
external usenet poster
 
Posts: 590
Default DATEDIF?

Yes ... (365.25/12) ... is close enough ... Thanks ... Kha

"MyVeryOwnSelf" wrote:

I need to determine fractional MONTHS between 2 Dates to 1 decimal
place (17.3 months).


Fractional months is a difficult concept to grasp when you consider
that a month is not a uniform unit of measure. A month can have from
28 to 31 days.


True, but on the average there are 365.25/12 days in a month. If that's
close enough for the OP, then something like
=(A2-A1)/(365.25/12)
might satisfy the need. Format the result as a number.



  #6   Report Post  
Posted to microsoft.public.excel.misc
Ken Ken is offline
external usenet poster
 
Posts: 590
Default DATEDIF?

Chip ... (Good morning)

For my post (365.25/12) is close enough ... However, I am working to
understand your solution as well for potential future application.

Thank you for supporting these boards & the many solutions you provide ... Kha

"Chip Pearson" wrote:

You can use a formula like

=DATEDIF(A1,B1,"m")+(B1-DATE(YEAR(B1),MONTH(B1),1))/DAY(DATE(YEAR(B1),MONTH(B1)+1,0))

where the start date is in A1 and the end date is in B1. The integer
portion of the result is the number of whole months between the two
dates. The fractional portion is the day of the end date divided by
the number of days in the end month. The same day of month for
different months will return different values, since a month can have
anywhere from 28 to 31 days. The whole idea of a "fraction of a month"
is a bit slippery and open to interpretation.

For example, if the end date is the 20th of the month, the fractional
portion will be 0.61 if the month has 31 days, 0.68 if the month has
28 days, and 0.63 if the month has 30 days. Take you pick as to which
is the "correct" answer.



Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



On Wed, 18 Mar 2009 13:36:52 -0700, Ken
wrote:

Excel2003 ...

I need to determine fractional MONTHS between 2 Dates to 1 decimal place
(17.3 months). DATEDIF is returning whole number of months which I cannot
seem to format to 1 decimal place.

How can you help me? ... Thanks ... Kha


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 806
Default DATEDIF?

Hello,

I suggest to use
=DATEDIF(A1,B1,"m")+WENN(DAY(B1)=DAY(A1),(DAY(B1)-DAY(A1))/(DAY(DATUM
(YEAR(B1),MONTH(B1)+1,0))),(DAY(DATUM(YEAR(A1),MON TH(A1)+1,0))-DAY
(A1))/(DAY(DATUM(YEAR(A1),MONTH(A1)+1,0)))+DAY(B1)/(DAY(DATUM(YEAR
(B1),MONTH(B1)+1,0))))
which is in line with DATEDIF(A1,B1,"d") calculation conventions, for
example.

Regards,
Bernd
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 806
Default DATEDIF?

This is the correct way to calculate it, I believe:
http://www.sulprobil.com/html/monthly_fractions.html

Regards,
Bernd
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() Brad Excel Discussion (Misc queries) 6 October 29th 08 06:35 PM
DATEDIF Deborah Excel Worksheet Functions 11 September 12th 07 04:06 PM
DateDif ? nhvwchic Excel Worksheet Functions 3 August 24th 06 08:40 PM
=DATEDIF Excel User001 Excel Worksheet Functions 2 February 3rd 06 04:20 PM
DateDif Average? Damn DateDif UTCHELP Excel Worksheet Functions 14 November 17th 05 10:30 AM


All times are GMT +1. The time now is 05:47 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"