• 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 month from 2 days

trprasad78

Member
Using datedif i able to count the month, but i am not getting expected result.

for example starting date 22-09-2016
End date 20-02-17

in above senor i need the out put as 6 = Sep,Oct,Nov,Dec,Jan,Feb total 6 month
if i use dated if i am getting 4 it count 30 days as month but in my case it has to count even if starting date 30-9-2016 we need to count september one month.

please refer attached file.
 

Attachments

  • sample.xlsx
    8.4 KB · Views: 5
Pls check it.

=(YEAR(B2)<>YEAR(A2))*13+MONTH(B2)-MONTH(A2)
or
=(YEAR(B2)<>YEAR(A2))*12+MONTH(B2)-MONTH(A2)+1


=(MONTH(B2)<MONTH(A2))*12+MONTH(B2)-MONTH(A2)+1
or
=(MONTH(B2)<MONTH(A2))*13+MONTH(B2)-MONTH(A2)
 
Last edited:
Pls check it.

=(YEAR(B2)<>YEAR(A2))*13+MONTH(B2)-MONTH(A2)
or
=(YEAR(B2)<>YEAR(A2))*12+MONTH(B2)-MONTH(A2)+1


=(MONTH(B2)<MONTH(A2))*12+MONTH(B2)-MONTH(A2)+1
or
=(MONTH(B2)<MONTH(A2))*13+MONTH(B2)-MONTH(A2)
Thank you :) it's working great :)
 
Back
Top