• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Oblivious...

Chanie

New Member
Hi there. I'm new to this forum and would LOVE to have a simple answer to the following:


First Part:


=DATEDIF(B4,C4, "y") & " years," & DATEDIF(B4,C4,"ym") &" months "


Second Part:


Use this calculation to calculate employee contributions. For example: $100.00 earnings multiplied by the total years and months of service - in this case it is 25 years and 11 months. The result should be $2591.67.


Working with different calculations I got a different result.


Any help would be appreciated.


Thanks everyone!
 
Hi Chanie


You should calculate the number of months and then convert to years

Code:
=DATEDIF(B4,C4,"m")/12

You will have 25.91666667 years
 
Hi, Chanie!


First of all welcome to Chandoo's website Excel forums. Thank you for your joining us and glad to have you here.


As a starting point I'd recommend you to read the three first green sticky topics at this forums main page. There you'll find general guidelines about how this site and community operates (introducing yourself, posting files, netiquette rules, and so on).


Among them you're prompted to perform searches within this site before posting, because maybe your question had been answered yet.


Feel free to play with different keywords so as to be led thru a wide variety of articles and posts, and if you don't find anything that solves your problem or guides you towards a solution, you'll always be welcome back here. Tell us what you've done, consider uploading a sample file as recommended, and somebody surely will read your post and help you.


And about your question...


I strongly recommend you to avoid using DATEDIF function as per the known bugs pointed out in my next post which I encourage you to read as well.


I'm sure mercatog will provide a workaround solution regarding the issue described downwards. If not, I'll get back to you later.


Regards!
 
@mercatog


Hi!


Regarding the DATEDIF function -and more indeed with the 3rd. parameter "m"- maybe you want to give a look to this topic and the related links:

http://chandoo.org/forums/topic/excel-2007


Regards!
 
@SirJB7


Hi!

Thanks for the link. Rarely I used DateDif and for the first time I see that it causes problems...

The problem of DateDif appears also with interval m?
 
@mercatog

Hi!

Not only but specially! And as buggy things who knows if specially is restricted to specifically, leaving the other parameters usable?

Give a look at the examples provided and how difficult was to find out the wrongly calculated cases... And with the easiness of the workaround...

Regards!

PS: May I suggest you to get back to Chanie first? Remember he/she asked for a simple answer. Then you can go on with your reading :)
 
@SirJB7

Hi!

Now, I recognize that I should have English courses or use online translator.

Sorry if I wrote something far from the subject.


Regards.
 
Hi Chanie,


If your Company calculate Contribution, only with Year & Month (not for the remaining day he doesn't works) then ..

Code:
=SUM(TEXT(C4-B4,"YY"),MONTH(C4-B4)/12)*A4

and If your Company Paid for the Days also in his contribution, then use

=CONVERT(C4-B4,"day","yr")*A4


I hope now you can manage the first Part..


Regards,

Deb
 
Back
Top