Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
jennifer
 
Posts: n/a
Default Month (datedif) to 1 decimal

Hello! Is there a way to calc the # of months between dates to 1 decimal
place? Other than taking the difference between 2 dates and dividing by 30.

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Month (datedif) to 1 decimal

DATEDIF can calculate the number of whole months, like so

=DATEDIF(A21,B21,"M")

there is no way that I now of to get to one decimal place because of the
different number of days in each month the algorithm is somewhat tricky. You
could do an approximation with

=DATEDIF(A21,B21,"YM")+DATEDIF(A21,B21,"MD")/30

which is a little better than (B21-A21)/30


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"jennifer" wrote in message
...
Hello! Is there a way to calc the # of months between dates to 1 decimal
place? Other than taking the difference between 2 dates and dividing by

30.

Thanks!



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Creator
 
Posts: n/a
Default Month (datedif) to 1 decimal

Hi Jennifer,
Try this
=YEARFRAC(C8,G8)*12

C8 and G8 being the cells with the two dates. Format cell to 1 decimal place
as required.
--
Creator


"jennifer" wrote:

Hello! Is there a way to calc the # of months between dates to 1 decimal
place? Other than taking the difference between 2 dates and dividing by 30.

Thanks!

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
jennifer
 
Posts: n/a
Default Thanks! Month (datedif) to 1 decimal

Bob & Creator - Thanks!

"jennifer" wrote:

Hello! Is there a way to calc the # of months between dates to 1 decimal
place? Other than taking the difference between 2 dates and dividing by 30.

Thanks!

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 incorrect month count - February problem?? JMKCT Excel Worksheet Functions 4 December 14th 05 03:36 PM
Working days left in the month compared to previous months qwopzxnm Excel Worksheet Functions 8 October 24th 05 08:00 PM
DATEDIF calculates a month off Mary New Users to Excel 1 June 27th 05 11:36 PM
Month Year Date Format Jamie Excel Worksheet Functions 2 February 7th 05 06:43 PM
How to extract month number from month name PM Excel Discussion (Misc queries) 2 January 19th 05 03:07 PM


All times are GMT +1. The time now is 02:22 PM.

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"