ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Converting number of days to years and months (https://www.excelbanter.com/excel-worksheet-functions/27600-converting-number-days-years-months.html)

Dave Cobb

Converting number of days to years and months
 
I want to convert the number of days in a cell (ie: 2350) to Xyears and
Ymonths. What formula to use?

Thanks,
Dave



N Harkawat

=INT(A1/365)&" years "&INT(MOD(A1,365)/30)&" months"


"Dave Cobb" wrote in message
news:rfLke.1280$5T2.1163@trnddc01...
I want to convert the number of days in a cell (ie: 2350) to Xyears and
Ymonths. What formula to use?

Thanks,
Dave





Ron Rosenfeld

On Tue, 24 May 2005 19:28:23 GMT, "Dave Cobb" wrote:

I want to convert the number of days in a cell (ie: 2350) to Xyears and
Ymonths. What formula to use?

Thanks,
Dave


You will need to define exactly what *you* mean by "years" and "months".

A year can have 365 or 366 days; and a month can have 28,29,30 or 31 days.

You could arbitrarily set a year at 365.25 days; and a month as 30 days, and
use the formula:

You could then use the formulas:

Years: =INT(N1/365.25)
and Days: =ROUND(MOD(N1,365.25),0)

But there are many other possible solutions.


--ron

Peo Sjoblom

There is not an exact way since there are leap years, if you don't care about
100% precision you can use =A1/365.25 or if you just want years without any
decimals

=YEAR(A1)-1900


Regards,

Peo Sjoblom

"Dave Cobb" wrote:

I want to convert the number of days in a cell (ie: 2350) to Xyears and
Ymonths. What formula to use?

Thanks,
Dave




Bob Phillips

difficult to be precise, as it depends upon the start point, but this might
get you started

=DATEDIF(TODAY(),TODAY()+A1,"y")&" years, " &
DATEDIF(TODAY(),TODAY()+A1,"ym")&" months,
"&DATEDIF(TODAY(),TODAY()+A1,"md")&" days"

--
HTH

Bob Phillips

"Dave Cobb" wrote in message
news:rfLke.1280$5T2.1163@trnddc01...
I want to convert the number of days in a cell (ie: 2350) to Xyears and
Ymonths. What formula to use?

Thanks,
Dave






All times are GMT +1. The time now is 03:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com