Hi All
How to convert decimals into years. For example i have my result as 1.5 , 1.58 , 1.41 and so on...
my message box should show 1Year . 6months, 1year.7months and so on.
how to write a vba code
Many thnx
Hi All
How to convert decimals into years. For example i have my result as 1.5 , 1.58 , 1.41 and so on...
my message box should show 1Year . 6months, 1year.7months and so on.
how to write a vba code
Many thnx
Hi...
You can use this:
Formula:Please Login or Register to view this content.
Now, you will have this result:
Formula:Please Login or Register to view this content.
As you can see 1,5 will give you 1 year, 06 months
but 1,58 will give you 1 year, 0,696 monhts.
If you want to round 0696 to 07 months then round result on 2 decimal places.
Is this OK for you?
Actually i am trying to convert calculate the number of days through a application.inputbox. I could manage for the number of days and months, but could not do that for the number of years. look into the code below.
For example if it is 37 months the third message box should show 3years.1month
Please note few variables have been declared just like that. i am very naive to processing . so my code might look bit horrible, Sorry guys.
Please Login or Register to view this content.
That's very ambiguous.
How many months and days are there from Jan 31 to Mar 1? From Jan 31 to 28 Feb?
Entia non sunt multiplicanda sine necessitate
Looks like i require i have to change the coding for months also. i know it should be 31 days on average. however for february i am quite not sure how to alter the code any suggestions
I dunno either. There's no way to calculate time differences like that that doesn't have anomalies.
Elapsed days is unambiguous.
look at my other post, i am somehow managed to solve the issue, my post name is calculation of years and months
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks