convert 3months and 15 days into 3.5
Hi I have created a formula to calculate the number of years, months and days between two dates, as follows:
"=IF(DATEDIF(A9,B9,""y"")=0,"""",DATEDIF(A9,B9 ,""y "")&"" years "")&IF(DATEDIF(A9,B9,""ym"")=0,"""",
DATEDIF(A9,B9,""ym"")&"" months "")&DATEDIF(A9,B9,""md"")&"" days"""
This works perfectly and returns a value of 1 year, 3 months and 15 days for example.
However what I would like it to return is 3.5 months or if the number of days is below 15 then round the number down to 3months.
Could you please help with this?
Many Thanks
|