+ Reply to Thread
Results 1 to 11 of 11

Calculating business hour between two days excluding holidays and weekends

  1. #1
    Registered User
    Join Date
    07-04-2012
    Location
    chennai
    MS-Off Ver
    Excel 2010
    Posts
    14

    Calculating business hour between two days excluding holidays and weekends

    Hello All,

    I am in need of calculating the number of hours between two days excluding the non office ours and weekends and holidays.Could any one help me on this.Thanks in advance.

    My work start time : 7 AM
    My work end time : 7 PM
    weekend :Saturday and Sunday

    User can start work at any time (ex . 6:45 AM) and finish at any time say 7:45 PM but the calculation only should happen between 7 AM and 7 PM.

  2. #2
    Registered User
    Join Date
    11-14-2012
    Location
    Brooklyn, NY
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Calculating business hour between two days excluding holidays and weekends

    please see attachment, if you were looking for a different solution please explain it

    Thank you
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    07-04-2012
    Location
    chennai
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Calculating business hour between two days excluding holidays and weekends

    I couldnt get what you have given in the attachement.

    In the attachement am unable to find any data related to time difference calculation.

    Actually what i need is time difference between two dates in days and hours ,it excluding holidays and non business hours .

    Thanks for your time on this.

  4. #4
    Registered User
    Join Date
    11-14-2012
    Location
    Brooklyn, NY
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Calculating business hour between two days excluding holidays and weekends

    To understand better: say you enter 10/16/12 & the next cell 11/09/12 it should calculate how many days. please explain if that it was you want and where are the hours coming into.

    Thank you

    P.S. if you can attach a sheet it would help!

  5. #5
    Registered User
    Join Date
    07-04-2012
    Location
    chennai
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Calculating business hour between two days excluding holidays and weekends

    Hello
    Please see the attachment
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    11-14-2012
    Location
    Brooklyn, NY
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Calculating business hour between two days excluding holidays and weekends

    Please see attached file, i hope i understand what you want, please let me know if you need any changes

    thank you
    Attached Files Attached Files

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Calculating business hour between two days excluding holidays and weekends

    i think you need to use =networkdays() you can convert that to hours by *8
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

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

    Re: Calculating business hour between two days excluding holidays and weekends

    JFR2262's solution works for me.....

    I have a standard formula for these, in this case it goes like this....

    =NETWORKDAYS(A6,B6,F$11:F$20)*12-12+IF(NETWORKDAYS(B6,B6,F$11:F$20),MEDIAN(MOD(B6,1)*24,7,19),19)-MEDIAN(NETWORKDAYS(A6,A6,F$11:F$20)*MOD(A6,1)*24,7,19)

    That will give you hours as a decimal, e.g. 27.5, if you want that as 27:30 then put parentheses round the formula and divide by 24
    Audere est facere

  9. #9
    Registered User
    Join Date
    07-04-2012
    Location
    chennai
    MS-Off Ver
    Excel 2010
    Posts
    14

    Smile Re: Calculating business hour between two days excluding holidays and weekends

    Hello JFR2262,

    Thank you so much for your help.Its great !!!

    Hello daddylonglegs,
    Thank you so much.Your formula also works well

  10. #10
    Registered User
    Join Date
    06-12-2014
    Posts
    1

    Re: Calculating business hour between two days excluding holidays and weekends

    Quote Originally Posted by christophertpj View Post
    Hello
    Please see the attachment
    Hi

    Instead of 7 to 7, I would like to change as 9:30 to 5:30 And also I want to consider 4 hours in Saturday...I.e fro 9:30 to 1:30.

    Could you please help me to modify the formula and send the attachment

    Thanks
    Shankar
    Last edited by alansidman; 06-13-2014 at 09:00 AM.

  11. #11
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,937

    Re: Calculating business hour between two days excluding holidays and weekends

    @Sankar_tsn

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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