+ Reply to Thread
Results 1 to 2 of 2

Dates in Excel - Counting the Number of Months in a Year

  1. #1
    Registered User
    Join Date
    06-04-2012
    Location
    Los Angeles
    MS-Off Ver
    Excel 2010
    Posts
    1

    Dates in Excel - Counting the Number of Months in a Year

    (Didnt realize I could add a spreadhseet to the post, See Attached) I am trying to come up with a formula that will count the number of months in the year that the license for a program has and I am getting stuck. Ex:

    Title Start Date End Date # Mos 2010 2011 2012 2013
    XXX 7/1/10 12/31/12 30 6 12 12 0
    YYY 11/1/10 4/30/13 30 2 12 12 4
    ZZZ 2/1/11 7/31/13 30 0 11 12 7

    currently, I am using the following formula for each cell under the 2010, 2011, 2012, and 2013 columns, but it isnt working because the datedif function is adding extra months for title ZZZ in 2013:

    =IF(ISERROR(IF($G10>=J$1,DATEDIF($G10,J$2,"m")+1,IF(J$2<=$H10,DATEDIF(J$1,J$2,"m"),DATEDIF(J$1,$H10,"m")+1))),0,IF($G10>=J$1,DATEDIF($G10,J$2,"m")+1,IF(J$2<=$H10,DATEDIF(J$1,J$2,"m"),DATEDIF(J$1,$H10,"m")+1)))

    If someone can come up with an easier solution/formula, i would appreciate it. Thanks!
    Attached Files Attached Files
    Last edited by uclaboy82; 06-04-2012 at 10:37 PM. Reason: add attachment

  2. #2
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Dates in Excel - Counting the Number of Months in a Year

    Hello
    try

    =DATEDIF(EOMONTH(F8,0),EOMONTH(I2,0),"m")

    ???
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1