• 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.

Count the number of months

Serene

Member
Hi everyone,


I would like to count the number of months from a field "Join Date" to a field "Resign Date". Both fields are in text. In this case, how can I calculate the number of months.

Can I also allow a decimal for the number of months.


Thank you in advance

Serene
 
Hi Serene,


You can use the datedif function. =DATEDIF(start_Date,end_date,"m").


However, Since your dates are in text format could you please share few examples?


Thanks,
 
Hi Serene ,


It all depends on what kind of a result you want ; do you want an answer rounded off either up or down , to the nearest month , or do you want a precise answer , down to two decimal places ?


If it is the former , what anand_babu has posted will do ; if it is the latter , it is somewhat more complicated.


Converting from text to date is done by using the DATEVALUE function , provided the text format follows your computer's default date format ; e.g. suppose we take the date 11/02/2013 ; this can be interpreted as either February 11 or November 2 , depending on whether your default date format is dd/mm/yyyy or mm/dd/yyyy.


The conversion from text to date will strictly follow your computer's default date format ; so if the intended date was February 11 , but your PC date format is mm/dd/yyyy , then the result of the conversion will be November 2.


Narayan
 
Hi guys


Thanks for your reply.

The formula works if I reference the end date to a cell instead of typing in the actual end date inside the formula. This is indeed a very useful function. Thanks again!


Serene
 
Back
Top