Date Question: Convert 7.45 years to "Hrs" / "Months" forma

Mopacs

New Member
Joined
Mar 6, 2002
Messages
33
Hello again,

I have a quick question. I am trying to determine the "difference" in Years and Months between two end dates (ie, subtract 1/2/1994 from 4/2/2002). When I subtract I get a decimal approximation (ie, 8.25.. where that would be roughly 8 years 3 months). HOw would I get Excel to convert this decimal value to a "YY years , MM months" format?

Any help would be greatly appreciated.

Thanks,

Rob
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
On 2002-05-02 14:02, Mopacs wrote:
Hello again,

I have a quick question. I am trying to determine the "difference" in Years and Months between two end dates (ie, subtract 1/2/1994 from 4/2/2002). When I subtract I get a decimal approximation (ie, 8.25.. where that would be roughly 8 years 3 months). HOw would I get Excel to convert this decimal value to a "YY years , MM months" format?

Any help would be greatly appreciated.

Thanks,

Rob

Will this formula work for you (assumes the later date is in cell B1):

=YEAR(B1)-YEAR(A1)+MIN(0,SIGN(MONTH(B1)-MONTH(A1)))&" years, "&MONTH(B1)-MONTH(A1)+MIN(0,SIGN(DAY(B1)-DAY(A1)))+MIN(0,SIGN(MONTH(B1)-MONTH(A1)))*-12&" months, "&IF(DAY(B1)-DAY(A1)<0,EOMONTH(A1,0)-A1+DAY(B1),DAY(B1)-DAY(A1))&" days"

Regards,
 
Upvote 0
On 2002-05-02 14:02, Mopacs wrote:
Hello again,

I have a quick question. I am trying to determine the "difference" in Years and Months between two end dates (ie, subtract 1/2/1994 from 4/2/2002). When I subtract I get a decimal approximation (ie, 8.25.. where that would be roughly 8 years 3 months). HOw would I get Excel to convert this decimal value to a "YY years , MM months" format?

Any help would be greatly appreciated.

Thanks,

Rob


Rob,


here are 2 ways to get years and months 1 text 1 formatting

In both cases D8 contains the difference in cell dates.

=INT(D8/365)&" Years, "&INT((D8-(365*INT(D8/365)))/30.25)&" Months"

If you want exactly years and months put this formula in

=TEXT(D8,"yy:mm")

<MARQUEE/> :cool: Hope This Helps :cool: </MARQUEE>
 
Upvote 0
A simpler solution would be to custom format the cell.

yy" years",m" months" as a custom format will yield 08 years,3 months.

yy:m will yield 8:3
 
Upvote 0

Forum statistics

Threads
1,213,549
Messages
6,114,261
Members
448,558
Latest member
aivin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top