+ Reply to Thread
Results 1 to 9 of 9

Networkdays function not working?

  1. #1
    Registered User
    Join Date
    12-29-2013
    Location
    NC
    MS-Off Ver
    Excel 2010
    Posts
    6

    Question Networkdays function not working?

    I'm trying to calculate the number of weekdays between 1-27-2013 (cell h3) and 6-11-2013 (cell L3). I have the formula =networkdays(H3,L3) with no holidays. the problem is when I format the result cell as a number it gives me 97. When I try to format as dd:hh:mm it gives me 06:00:00. Can someone please explain this and how I can correct it so the format reads 97:00:00?

    Thank You!

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Networkdays function not working?

    It won't work as you want.

    The dd format will only work up to the number of days in a specific month.

    The reason you're getting 6:00:00 is because the number 97 is the date serial number for Apr 6 1900.

    The best you can do is have the formula return the TEXT string 97:00:00.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    12-29-2013
    Location
    NC
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Networkdays function not working?

    I've tried =text(NETWORKDAYS(H3,L3), dd:hh:mm), but this doesn't seem to work either. Is it not right?

  4. #4
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Networkdays function not working?

    welcome to the forum. as Tony mentioned, using dd wouldn't work at all. have you tried formatting dates to a custom format before? say you have 1jan2013
    d-mmm-yy
    will show
    1-Jan-13

    dd-mmm-yy
    will show
    01-Jan-13

    so the furthest it can go to is 31. and like what Tony mentioned, the number 97 actually represents a Date if you format as such. 1 is 1 Jan 1900. 2 is 2 Jan 1900. so when it reaches 97, it is 6 Apr 1900. so dd-mmm-yy will give you
    06-Apr-00

    NETWORKDAYS is not going to give you hours & minutes, so your last 2 sets of 0s are always 0s. so maybe just:
    =TEXT(NETWORKDAYS(H3,L3),"00")&":00:00"

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  5. #5
    Registered User
    Join Date
    12-29-2013
    Location
    NC
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Networkdays function not working?

    Thanks for your responses. Neither worked. also I'm guessing that since I'm trying to format text that I won't be able to perform math functions. I may just have to deal with formatting as a number.

    Again thank you for your help.

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Networkdays function not working?

    Quote Originally Posted by sherringtonjr View Post
    I'm guessing that since I'm trying to format text that I won't be able to perform math functions.
    benishiryo's formula returns a TEXT string so yes, you are correct.

    Good luck!

  7. #7
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Networkdays function not working?

    You can continue to use the standard networkdays function to return 97

    Apply a custom format of

    ##":00:00"

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Networkdays function not working?

    you could multiply it by 10000 then custom format as
    00\:00\:00 remembering to divide again by 10000 in subsequent calculations
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Networkdays function not working?

    Quote Originally Posted by Jonmo1 View Post
    You can continue to use the standard networkdays function to return 97

    Apply a custom format of

    ##":00:00"
    Good thinking!

+ 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] IF function not working with dates and NETWORKDAYS
    By Hendar in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-08-2013, 06:49 AM
  2. NETWORKDAYS only working on VBE
    By bagullo in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-29-2011, 11:51 AM
  3. NETWORKDAYS not working
    By corinereyes in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-19-2007, 08:06 AM
  4. Replies: 7
    Last Post: 05-22-2006, 03:35 PM
  5. Networkdays Function Not Working
    By Al H. in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-11-2005, 11:06 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