+ Reply to Thread
Results 1 to 7 of 7

I need help producing a report that shows number of days within a certain date range

  1. #1
    Registered User
    Join Date
    09-26-2012
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    2

    I need help producing a report that shows number of days within a certain date range

    Hi All,

    I am currently writing a report to show the absence per month by employees, for 1200 employees! So ther report is by month, for june, july, august and september.

    Some of the employees have absences longer than a month e.g 14/04/2012 - 27/07/2012. This creates a problem as the total days that it shows aren't correct, as it will show the total - not just for June.

    Does anyone have a formula or a theory as to how I can work this, without doing it manually??

    I have attached the spreadsheet for you to look at. If you can help, it would be amazing!! and save me so much time.

    Thanks,

    Emily
    Attached Files Attached Files
    Last edited by crazyem91; 09-26-2012 at 07:25 AM.

  2. #2
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: I need help producing a report that shows number of days within a certain date range

    Check out this workbook. Is this what you are looking for? The NETWORKDAYS formulas that I used don't count weekend days.

    The result is pretty pretty but the formula is not...

    It wouldn't surprise me if some smart person on this forum could take that formula down to something more compact, that would be cool. I started filling in holidays but you have to finish it. The holidays are in a named range. You know that little window up to the left where the address of your current cell is shown? Click that arrow and you'll see the named range. You may have to expand it. Should have been dynamic but I don't master that yet.

    Also there is some conditional formatting, it just made it easier on the eyes to tone down those zeros.
    Attached Files Attached Files
    Last edited by Jacc; 09-26-2012 at 03:08 PM.

  3. #3
    Registered User
    Join Date
    09-26-2012
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: I need help producing a report that shows number of days within a certain date range

    Wow Thank you Jacc, you have really helped me! My boss will be so happy will report back on what they say!!

    Thanks again. wish I was an expert with Excel!

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: I need help producing a report that shows number of days within a certain date range

    This version should give the same results....

    =MAX(0,NETWORKDAYS(MAX($A11,D$2+1),MIN($B11,E$2),Holidays))
    Audere est facere

  5. #5
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: I need help producing a report that shows number of days within a certain date range

    Glad I could help! Looking forward to even more feedback, Emily. I hope this forum will inspire you to learn Excel.

    Sorry daddylonglegs, your formula does not produce the same result. I get numbers between 19 and 23 on each month. Love to see a smarter formula though. I just have a feeling it is possible.
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: I need help producing a report that shows number of days within a certain date range

    Quote Originally Posted by Jacc View Post
    Sorry daddylonglegs, your formula does not produce the same result.
    It normally would but the "dates" in columns A and B are actually text formatted - try ISNUMBER(A11) to check - so that messes with my MIN and MAX functions - this slightly tweaked version should work on the data "as is"

    =MAX(0,NETWORKDAYS(MAX($A11+0,D$2+1),MIN($B11+0,E$2),Holidays))

    or just convert columns A and B to real dates using text to columns and my original version works - see attached

    I note that in some rows there is no end date - what should happen there? This version will return zero if there is no end date

    =IF(LEN($A11)*LEN($B11),MAX(0,NETWORKDAYS(MAX($A11+0,D$2+1),MIN($B11+0,E$2),Holidays)),"")
    Attached Files Attached Files
    Last edited by daddylonglegs; 09-27-2012 at 07:49 PM.

  7. #7
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: I need help producing a report that shows number of days within a certain date range

    Quote Originally Posted by daddylonglegs View Post
    This version should give the same results....

    =MAX(0,NETWORKDAYS(MAX($A11,D$2+1),MIN($B11,E$2),Holidays))
    Now that I look at it with a clear mind (my last post was past bed time ) I see a very simple and easy to understand formula. Emily, are you taking notes? This is what it's supposed to look like.
    Yes I saw that there was something funny with the format of the dates. I would fix the format and keep this simple formula.

+ 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