+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    09-24-2008
    Location
    London UK
    Posts
    15

    Date Calculation using NETWORKDAYS

    Hi - it's me again.

    I'm producing a spreadsheet showing jobs outstanding on a helpdesk system. I have a title at the top reading 'Oustanding jobs as at' and have isolated the next cell which contains the function =TODAY(). In the body of the sheet is a columnar list of outstanding jobs with one column showing the date the job was submitted. The next column is headed 'Days Outstanding' and contains the formula = NETWORKDAYS(E1,D5) (where E1 is the isolated cell in the title and D5 is the first cell containing an outstanding job submission date). All relevant cells are formatted to 'Date' in the 19/3/2010 format.

    This is returning a number of days outstanding for each job, which is what I expected. The problem is that a job logged today is shown as being one day outstanding, and a job logged yesterday as two days. Obviously anything logged today should be returning a value of zero, and all my figures are out by one day.

    Two questions:

    1) Why is this happening? Excel processes dates, however they are shown, as numbers. A particular date must represent a particular number, and when you subtract a number from itself the answer is inevitably zero. I really don't understand this at all.

    2) How can I fix it? I tried the obvious by appending -1 to the end of the function but it threw a hissy fit and decided to return a date of 1/1/1900, which really wasn't helpful!

    Many thanks in advance for hopefully solving a numpty's second query in two days. My first was resolved yesterday, only a couple of working hours after I posted it, which |I think is awesome!
    Last edited by Moondog; 03-19-2010 at 01:39 PM.

  2. #2
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,379

    Re: Date Calculatiion using NETWORKDAYS

    NETWORKDAYS treats the days as being inclusive - ie if you started work today and left work today you worked 1 day not 0 days.

    To make exclusive you should as you have already outlined - subtract 1 from the result - ie NETWORKDAYS(E$1,D5)-1

    Ensure the cell is formatted as General ... 1 in date form would show as 01/01/1900 whereas 0 would show as 00/01/1900
    Last edited by DonkeyOte; 03-19-2010 at 08:53 AM. Reason: typo

  3. #3
    Registered User
    Join Date
    09-24-2008
    Location
    London UK
    Posts
    15

    Re: Date Calculatiion using NETWORKDAYS

    Why is it that I cane my brain looking for the solution, and yet when someone gives it to you it seems so obvious?

    Thank you, DonkeyOte. It seems I was doing everything right except formatting the cells to 'General'! It appears that the cells were autoformatting themselves to 'Date', probably because of the two date formats contained in the function.

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.2.0