What is in cell A1? Their term? Is it a proper Excel date? (if you go to format that cell, what does it say it's formatted as?)
This is a discussion on Formula to convert fraction of year to months within the Excel Questions forums, part of the Question Forums category; I work in a prison. Inmates can apply for pre-release when they have half their minimum sentence served. For example ...
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.
What is in cell A1? Their term? Is it a proper Excel date? (if you go to format that cell, what does it say it's formatted as?)
A1 is their minimum date such as 1/28/2015. If I could figure out how many months then I could just use =DATE(YEAR(A1),MONTH(A1)-B5,DAY(A1)) where the -B5 would be the months.
Last edited by Seph; Jan 28th, 2012 at 08:44 AM.
Then we also need to know when the sentence started being served.
With those two bits of data, as long as all dates are proper Excel dates, then halve the difference and add to the start date:
A B 1 Jan 28 2015 minimum term release date 2 3 Jan 28 2012 Sentence start 4 5 Jul 29 2013 Pre-release application date
Spreadsheet Formulas
Cell Formula A5 =A3+(A1-A3)/2
Excel tables to the web >> Excel Jeanie HTML 4
Also posted at http://www.excelforum.com/excel-gene...to-months.html
Microsoft MVP - Excel
Bookmarks