Results 1 to 4 of 4

Thread: Calculation of business hours in Excel

  1. #1
    Join Date
    Jan 2009
    Posts
    79

    Calculation of business hours in Excel

    Hi friends,

    I have created a formula in excel where it calculates business hour and following are the code for the same
    =(NETWORKDAYS(D9,E9)-1)*("17:00"-"08:00")+IF(NETWORKDAYS(D9,E9),MEDIAN(MOD(E9,1),"17:00","08:00"),"17:00")-MEDIAN(NETWORKDAYS(D9,E9)*MOD(D9,1),"17:00","08:00")

    Where Start time D9 and End Time E9.

    But this formula doesn't work properly when the days are same.

    Can anyone fix this issue for me.

  2. #2
    Join Date
    Dec 2008
    Posts
    97

    Re: Calculation of business hours in Excel

    Try to use IF statement to reflect entries on the same day

    =IF(NETWORKDAYS(D9,E9)<2,(E9-D9)*24,(NETWORKDAYS(D9,E9)-2)*8+(17-HOUR(D9))*(HOUR(D9)<=17)+(HOUR(E9)-9))

    I am sure it will work for you.

  3. #3
    Join Date
    May 2008
    Posts
    4,570

    Re: Calculation of business hours in Excel

    As i can see in your formula that second and third NETWORKDAYS functions are not correct, the first one should use E9 twice and the second one D9 twice. So the formula should be

    =(NETWORKDAYS(D9,E9)-1)*("17:00"-"08:00")+IF(NETWORKDAYS(E9,E9),MEDIAN(MOD(E9,1),"17:00","08:00"),"17:00")-MEDIAN(NETWORKDAYS(D9,D9)*MOD(D9,1),"17:00","08:00")

  4. #4
    Join Date
    Jul 2009
    Posts
    1

    Re: Calculation of business hours in Excel

    =(NETWORKDAYS(D9,E9)-1)*("17:00"-"08:00")+IF(NETWORKDAYS(E9,E9),MEDIAN(MOD(E9,1),"1 7:00","08:00"),"17:00")-MEDIAN(NETWORKDAYS(D9,D9)*MOD(D9,1),"17:00","08:00 ")


    hi all, for the above formula...y the second part have to use IF but in the last part not using IF and using MEDIAN(NETWORKDAYS(D9,D9)*MOD(D9,1)?

Similar Threads

  1. Replies: 2
    Last Post: 28-04-2012, 07:17 AM
  2. Calculation Repeatability & Reproducibility on Microsoft Excel
    By Ella Mentry in forum MS Office Support
    Replies: 2
    Last Post: 09-02-2012, 06:35 PM
  3. calculation of date, month and year using excel
    By Edgar-Arular in forum Windows Software
    Replies: 4
    Last Post: 06-04-2011, 04:26 PM
  4. 2003 excel calculation error
    By titanpro in forum Windows Software
    Replies: 2
    Last Post: 20-07-2009, 07:01 PM
  5. Excel 2003 calculation automatic loss option
    By CitricAcid in forum Software Development
    Replies: 4
    Last Post: 08-04-2009, 10:09 AM

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
  •  
Page generated in 1,714,319,716.10283 seconds with 17 queries