Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Apr 2001
    Location
    SOUTH AFRICA
    Posts
    74
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Calculate diff between dates (97)

    Hi all,

    Can you please give me the formula and/or coding to calculate the difference between two dates. Also, what must the format of the cells be. I tried the following: cells formatted as date ie: 03/04/2000 and formula =networkdays(a1,b1,0) but this doesn't work.

    Thanks a lot

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calculate diff between dates (97)

    Can you tell us what "but it doesn't work" means? Are you getting the wrong answer? An error? If so what error?

    To use NetWorkDays, you must install the Analysis Toolpak (select Addins from the Tools menu and check Analysis Toolpak in the list).

    This works for me to get the total number of days:

    <pre>=DATEDIF(A1,B1,"D")
    </pre>


    And this works to get the number of workdays:

    <pre>=NETWORKDAYS(A1,B1)
    </pre>

    Legare Coleman

  3. #3
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Calculate diff between dates (97)

    Rene, I didn't have any problem with this. Try this simple exercise:
    1) Enter 9/28/2001 in cell A1
    2) Enter 10/20/2001 in cell B1
    3) Enter =B1-A1+1 in cell C1
    4) Use the Format, Cells menu & the number tab to format C1 as a number with 0 decimals. This gives the number of days (23).
    5) Enter =NETWORKDAYS(A1,B1) in cell D1. This gives the number of working days (16).

    Here in the US, for some of us 10/8/2001 was a holiday. If I enter 10/8/2001 in cell A3, and enter the formula =NETWORKDAYS(A1,B1,A3) in cell E1, then I get 15 as the result. See attachment for a little more fancy example. Hope this helps! --Sam
    Attached Files Attached Files
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  4. #4
    Star Lounger
    Join Date
    Apr 2001
    Location
    SOUTH AFRICA
    Posts
    74
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calculate diff between dates (97)

    Thanks a lot Legare and Sam, both ways works 100%

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •