+ Reply to Thread
Results 1 to 13 of 13

Can i count the number of months in a specific range

Hybrid View

  1. #1
    Registered User
    Join Date
    09-20-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    13

    Can i count the number of months in a specific range

    Hi Everyone..

    Refer to the attached excel file,
    The green line is the total sum of man-hours that Robin needed to do in a month.
    If you look at the data, there are certain month where he does not require to work..

    So the data that i want to count is the "Plan Duration" and "Actual Duration"..
    Where,
    Plan Duration: The month count of when he start to finish (sept 2011 - oct 2012; Count: 14)
    Actual Duration: The month count of his actual work.. (Sept,dec,mar-oct; Count: 10)


    For Actual duration it's easy for me as I've used
    =COUNTIF(F87:AY87,">0")

    But I'm Stuck as to how i am going to count my Plan Duration..
    Is there a way where i can tell excel to lookup the First value and last value and count the months in between?

    I've tried combining index & match but i guess I'm not that great to fully apply it properly..
    I know it sounds complicated, but I'll really appreciate it.. Thanks in adv...
    Attached Files Attached Files
    Last edited by radicrains; 09-20-2011 at 08:02 PM. Reason: Wrong use of title & change of attachment into a workbook

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,024

    Re: Index?match? help me please

    This is nice pdf but please upload excel workbook as example.

    Also, please rename your title according to the rules:

    1. Use concise, accurate thread titles. Your post title should describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change the title of the thread, click EDIT on the original post, then click the Go Advanced button, then change the title. If two or more hours have passed, the EDIT button will not appear, and you need to ask a moderator to change the title.
    Never use Merged Cells in Excel

  3. #3
    Forum Contributor
    Join Date
    08-01-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2007
    Posts
    182

    Re: Index?match? help me please

    Hi radicrains,

    Welcome to the forum.

    If you are looking from start to finish you can use a simple Count formula.
    If you are looking for only the months in which he is supposed to work, I guess the Countif formula will work there as well.

    Probably I am missing something in your question.

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,024

    Re: Index?match? help me please

    inayat, your post is against rule number 7:

    7. Don't ignore requests by Administrators, Moderators, or senior members of the forum. If you are unclear about their request or instructions, then send a private message to them asking for help. Do not post a reply in a thread where such a request (e.g., title change, code tags) is pending.

  5. #5
    Forum Contributor
    Join Date
    08-01-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2007
    Posts
    182

    Re: Index?match? help me please

    @zbor... I was looking at this thread before your post. However it took me sometime to reply. Once I replied after that only I saw your post. If I had seen the post I definetly would not have replied. Sorry for that. In future will ensure that it does not happen.

  6. #6
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Index?match? help me please

    inayat, try out the F5 key on a thread before you post, especially if you took a while writing your comment.

    radicrains, I second zbor's request for a title change.

  7. #7
    Registered User
    Join Date
    09-20-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Can i count the number of months in a specific range

    @Zbor, I've made the necessary changes... Thanks..

    @Inayat, I know that count is possible, but If i have over 100 engineers to count their month, i find it very tedious to manually choose the data from when he start to when he finish... is there a formula for excel to just count the range on month that he has worked?

    @teylyn, noted.. Changes have been made..


    Thanks guys!

  8. #8
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Can i count the number of months in a specific range

    radicrains,

    where is the data for the planned duration? The green row sums up the row below, so that is all actual, right? Where do you record the plan, then?

  9. #9
    Registered User
    Join Date
    09-20-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Can i count the number of months in a specific range

    Scroll to the right.. it's the last 2 columns..

    Quote Originally Posted by teylyn View Post
    radicrains,

    where is the data for the planned duration? The green row sums up the row below, so that is all actual, right? Where do you record the plan, then?

  10. #10
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,024

    Re: Can i count the number of months in a specific range

    Try this:

    =1+MAX(IF($D6:$AY6>0,COLUMN($D6:$AY6)))-MIN(IF($D6:$AY6>0,COLUMN($D6:$AY6)))

    Comfirmed with ctrl+shift+enter

  11. #11
    Registered User
    Join Date
    09-20-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Can i count the number of months in a specific range

    Wow! Thank you so much!

    May i know why do i need Ctrl+Shift+Enter for the formula to work rather than the usual enter...

  12. #12
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,024

    Re: Can i count the number of months in a specific range

    It's called array formula.

    An array formula is a formula that works with an array, or series, of data values rather than a single data value.

    Like in this example ...IF($D6:$AY6>0... it check for whole ARRAY where it's greater then 0.

    To enter a formula as an array formula, type the formula in the cell and press the CTRL SHIFT and ENTER keys at the same time rather then just ENTER. You must do this the first time you enter the formula and whenever you edit the formula later. If you do this properly, Excel will display the formula enclosed in curly braces { }. You do not type in the braces -- Excel will display them automatically. If you neglect to enter the formula with CTRL SHIFT ENTER, the formula may return a #VALUE error or return an incorrect result.

  13. #13
    Registered User
    Join Date
    09-20-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Can i count the number of months in a specific range

    Oh wow, nice! Thank you.. Really appreciate the help!

+ 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