+ Reply to Thread
Results 1 to 6 of 6

Months in a year based on number of days

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    09-15-2012
    Location
    las vegas
    MS-Off Ver
    excel 2007
    Posts
    147

    Months in a year based on number of days

    I'm trying to figure out a function that converts number of days into number of months.

    I attached the sample. I didn't get to the number of months just the number of days. I want the result to be as exact as possible.

    I first thought of averaging 365 days and the 12 months and use the value output as denominator for the number days. There might be another way but I don't know what it is.

    The data is only for date range for 2014, but the data can be (for example) from 03-01-2012 to 06-20-2014.

    Thank you.
    Attached Files Attached Files

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Months in a year based on number of days

    Using your posted workbook...
    this regular formula returns the number of full months in the referenced date range
    A3: =DATEDIF(B3,C3+1,"M")
    In your example, 01-Mar-2014 to 15-Jul-2014 is 4 full months.

    Does that help?
    (BTW, if you're attaching a workbook with Calculation set to Manual...it would be nice if you warned us. :\)
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Forum Contributor
    Join Date
    09-15-2012
    Location
    las vegas
    MS-Off Ver
    excel 2007
    Posts
    147

    Re: Months in a year based on number of days

    On the specific example you just stated, the answer should be around 4.5 because March to June is 4 and July 1-15 is half.

    Thanks.

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Months in a year based on number of days

    Try this formula:
    A3: =DATEDIF(B3,C3+1,"M")+DAY(C3)/DAY(EOMONTH(C3,0))

    For 01-Mar-2014 through 15-Jul-2014 that formula returns: 4.48387096774194
    The fraction is 15/31_days_in_July

    Is that something you can work with?

  5. #5
    Forum Contributor
    Join Date
    09-15-2012
    Location
    las vegas
    MS-Off Ver
    excel 2007
    Posts
    147

    Re: Months in a year based on number of days

    Yes, Sir. Thanks

  6. #6
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Months in a year based on number of days

    Glad you got something you can use!

    If that resolves your issue, please take a moment to mark this thread as SOLVED (from the Thread Tools menu)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] How to transform a number in year/months/days
    By pgft in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 01-28-2014, 09:52 AM
  2. Replies: 8
    Last Post: 05-10-2013, 05:37 AM
  3. [SOLVED] Number of days based on 365 day year
    By m.dominguez in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-16-2013, 02:54 PM
  4. Days into Months/Year
    By easycapital in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-30-2008, 06:59 PM
  5. i have two days and i want the difference in days, months, year
    By maja in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-21-2006, 08:14 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1