+ Reply to Thread
Results 1 to 10 of 10

Convert decimal to months

  1. #1
    Registered User
    Join Date
    05-26-2011
    Location
    Pennsylvania
    MS-Off Ver
    Excel 2003
    Posts
    6

    Question Convert decimal to months

    Hello,

    I work in a prison. Inmates can apply for pre-release when they have half their minimum sentence served. For example 2 years 6 months. They would have to serve 1 year 3 months. I use this formula =DATE(YEAR(A1)-A5,MONTH(A1)-B5,DAY(A1)-B6) where A1 is half the years, B5 is half the months, and B6 is half the days. The problem is when an inmate is sentenced to a minimum of 3 years and 3 months. The latter formula will not calculate 1.5 years or 1.5 months. It rounds up. What I would like to do is covert the 1.5 years to months and the 1.5 months to days.
    Last edited by djseph; 02-04-2012 at 11:03 AM.

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Convert decimal to months

    Hi djseph,

    I think a sample file will help in better understanding of the issue. Alternatively, try googling DateDif function which may give you some hint. Thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Convert decimal to months

    Another way, perhaps:

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Valued Forum Contributor mahju's Avatar
    Join Date
    11-27-2010
    Location
    Pakistan, Faisalabad
    MS-Off Ver
    Excel 2010 plus
    Posts
    730

    Re: Convert decimal to months

    Hi

    If A1 has decimal years or decimal months e.g 4.35 then use

    Decimal Years to months
    Please Login or Register  to view this content.
    Decimal months to days
    Please Login or Register  to view this content.
    Mark the thread as solved if you are satisfied with the answer.


    In your first post under the thread tools.

    Mahju

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Convert decimal to months

    djseph,

    Please take a few minutes to read the forum rules about cross-posting.

    Thanks.

  6. #6
    Registered User
    Join Date
    05-26-2011
    Location
    Pennsylvania
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Convert decimal to months

    Sorry shg. I failed to read the rules. I asked to delete the cross post.

    Here is an actual inmates situation:

    preR.jpg

    B8 contains =DATE(YEAR(B3)-B6,MONTH(B3)-C6,DAY(B3)-D6)
    This gives me the right date if I manually divide the minimum sentence. I want to enter the minimum sentence in b5, c5, and d5 and have it divided by half for me. However the latter formula will not calculate .5 or 1.5 years. It rounds up thus giving me the wrong date.

  7. #7
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Convert decimal to months

    Hi djseph,


    I would suggest you to work on number of days i.e., 1 year 10 months and 15 days = 680 days (approx.).
    So after serving this much term, pre release can be initiated. Thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  8. #8
    Valued Forum Contributor mahju's Avatar
    Join Date
    11-27-2010
    Location
    Pakistan, Faisalabad
    MS-Off Ver
    Excel 2010 plus
    Posts
    730

    Re: Convert decimal to months

    Hi
    Based on the year length=365 days and month length=30 days

    Please check the attached.

    If it is not helpful please upload the sample file (Not image)

    Regards
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    05-26-2011
    Location
    Pennsylvania
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Convert decimal to months

    Mahju,

    Your a genius. I would have never come up with that myself. You are definitely 100% above my ability. For all those that have replied thank you very much. I wish I had half of your talent.

  10. #10
    Valued Forum Contributor mahju's Avatar
    Join Date
    11-27-2010
    Location
    Pakistan, Faisalabad
    MS-Off Ver
    Excel 2010 plus
    Posts
    730

    Re: Convert decimal to months

    You are welcome

    Please mark the thread as solved so other may not waist time on openining and seeing this thread.

    Forum Rule:
    If your problem is solved, please say so clearly, and mark your thread as Solved: Click the Edit button on your first post in the thread, Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Edit button will not appear -- ask a moderator to mark it.


    Thanks and regards

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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