+ Reply to Thread
Results 1 to 5 of 5

Adjusting formula to calculate weekdays only

  1. #1
    Registered User
    Join Date
    05-22-2012
    Location
    Calgary Alberta
    MS-Off Ver
    Excel 2010
    Posts
    42

    Adjusting formula to calculate weekdays only

    I have the following formula....
    =IF(B6<1,"",IF(I6<1,"PENDING",IF(J6>0,J6-I6,"PENDING")))
    Where B6 = Job Number
    Where I6 = Date Received
    Where J6 = Date Completed
    This calculates calendar days but now I need it to calculate only business days.
    Not sure where within this equation I should insert the NETWORKDAYS function

  2. #2
    Forum Contributor
    Join Date
    01-22-2014
    Location
    genoa, italy
    MS-Off Ver
    Excel 2007
    Posts
    134

    Re: Adjusting formula to calculate weekdays only

    =IF(B6<1,"",IF(I6<1,"PENDING",IF(J6>0,NETWORKDAYS(I6,J6),"PENDING")))

    does this work ?

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: Adjusting formula to calculate weekdays only

    Have you tried:
    =IF(B6<1,"",IF(I6<1,"PENDING",IF(J6>0,NETWORKDAYS(I6,J6),"PENDING")))

    or (if done one day = 0)
    =IF(B6<1,"",IF(I6<1,"PENDING",IF(J6>0,NETWORKDAYS(I6,J6)-1,"PENDING")))
    Best Regards,

    Kaper

  4. #4
    Registered User
    Join Date
    05-22-2012
    Location
    Calgary Alberta
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: Adjusting formula to calculate weekdays only

    That worked perfectly.
    Now I have to do the same for formulas where multiple dates are considered. (Below...)
    Formula 1
    =IF(B5<1,"",IF(H5<1,"PENDING",IF(P5>0,(P5-N5)+(M5-K5)+(J5-H5),"PENDING")))

    Formula 2
    =IF(B5<1,"",IF(M5<1,"PENDING",IF(N5>0,N5-M5,"PENDING")))

    B5=Job Number
    H5=Date Submitted to Dept. #1
    J5=Date Received by Dept. #2
    K5=Date Completed by Dept. #2
    M5=Date Received by Dept. #3
    N5=Date Completed by Dept. #3
    P5=Date Completed by Dept. #1

    I keep getting too few arguments

  5. #5
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: Adjusting formula to calculate weekdays only

    Formula 2
    =IF(B5<1,"",IF(M5<1,"PENDING",IF(N5>0,N5-M5,"PENDING")))
    can be changed into one using networkdays exactly as above
    =IF(B6<1,"",IF(I6<1,"PENDING",IF(J6>0,J6-I6,"PENDING")))
    into
    =IF(B6<1,"",IF(I6<1,"PENDING",IF(J6>0,NETWORKDAYS(I6,J6)-1,"PENDING")))

    But as it is excatly the same problem - I leave it to you as a "homework".

    As first one is considered - - the "frame" can be the same
    =IF(B5<1,"",IF(H5<1,"PENDING",IF(P5>0,(P5-N5)+(M5-K5)+(J5-H5),"PENDING")))
    The only part which tequires changing is the inner one:
    (P5-N5) + (M5-K5) + (J5-H5)
    you have sum of three parts here.
    So in final formula there will be sum of 3 NETWORKDAYS formulas

    NETWORKDAYS(N5,P5)+NETWORKDAYS(K5,M5)+NETWORKDAYS (H5,J5)-3
    (this -3 is necessary, if we count part started and finished the same day as 0)

    Enjoy!

    Kaper

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Calculate weekdays and Average in same
    By nicci113 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-03-2014, 06:48 AM
  2. Excel Formula to calculate working hours between two dates excluding weekdays with wh
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-28-2013, 11:20 AM
  3. SUMPRODUCT used to calculate Number of weekdays, returns #VALUE in VBA
    By suchi0508 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-30-2012, 10:02 AM
  4. Calculate last 10 weekdays
    By deliguy in forum Excel General
    Replies: 4
    Last Post: 02-14-2012, 11:19 AM
  5. How to calculate the number of specific weekdays in a month
    By rowlandrat in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-10-2011, 09:58 AM

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