I need to calculate the number of last days of months between two dates. So, for example,
8 Dec 13 to 11 May 14, the answer should be 5 as there have been 5 month ends between these two dates.
Can anyone help, please?
I need to calculate the number of last days of months between two dates. So, for example,
8 Dec 13 to 11 May 14, the answer should be 5 as there have been 5 month ends between these two dates.
Can anyone help, please?
Perhapes this:
=TEXT(B1-A1-(DAY(B1)>=DAY(A1)),"m")
I tried this and it almost works. Each time I test it with different dates it is one month out. The result to the example in the OP shows 6 when it should be 5 so it is one month over. But when I use other dates that contain the last day of a month, e.g. 31 Dec 13 to 30 April the result is one month under.
How about this:
Formula:Please Login or Register to view this content.
You can also use this
=DATEDIF(A2,B2,"m")
A B C 2 12/8/2013 5/11/2014 5
If you like my answer please click on * Add Reputation
Don't forget to mark threads as "Solved" if your problem has been resolved
"Nothing is so firmly believed as what we least know."
--Michel de Montaigne
Can you elaborate this?
because I get with both approach:
Please Login or Register to view this content.
Try
=DATEDIF(A1,B1,"m")+(DAY(A1)>DAY(B1))+(MONTH(B1)<>MONTH(B1+1))
A1=start date
B1=end date
You're welcome.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks