Results 1 to 6 of 6

Thread: DATEDIF Grief

  1. #1
    3 Star Lounger baumgrenze's Avatar
    Join Date
    Feb 2001
    Location
    California, USA
    Posts
    262
    Thanks
    6
    Thanked 0 Times in 0 Posts

    DATEDIF Grief

    I gather that Excel 2000 running under Win7 PRO X64 should still be able to calculate the difference between 9/1/2003 and 3/22/1940, and express it as years, months, or days.

    Here is the syntax I used: =DATEDIF(A1, B1, m)

    When I try it it returns #NAME?

    When I simply try A2 - B2 it delivers the date '6/11/1963 0:00' which makes no sense to me.

    What am I doing wrong?

    thanks
    Baumgrenze
    Hier sind wir tief eingewurzelt.

  2. #2
    2 Star Lounger
    Join Date
    Aug 2014
    Posts
    111
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by baumgrenze View Post
    I gather that Excel 2000 running under Win7 PRO X64 should still be able to calculate the difference between 9/1/2003 and 3/22/1940, and express it as years, months, or days.

    Here is the syntax I used: =DATEDIF(A1, B1, m)

    When I try it it returns #NAME?

    When I simply try A2 - B2 it delivers the date '6/11/1963 0:00' which makes no sense to me.

    What am I doing wrong?

    thanks
    Try this

    =DATEDIF(A1, B1, "m")

    Regards
    Gordon

  3. #3
    3 Star Lounger baumgrenze's Avatar
    Join Date
    Feb 2001
    Location
    California, USA
    Posts
    262
    Thanks
    6
    Thanked 0 Times in 0 Posts
    I see now that I can accomplish what I want to do by taking the difference, dividing it by 365, and formatting the cell as a number with 1 or 2 decimals to reduce confusion.

    I saved a simple example of the xls file and tried to upload it using 'Manage Attachments' but I could not find it. It is there in Windows Explorer but does not show in 'Manage Attachments'. Do I need to close this i SeaMonkey window and then reopen the forum and thread to have access to recently saved files?


    thanks
    Baumgrenze
    Hier sind wir tief eingewurzelt.

  4. #4
    3 Star Lounger baumgrenze's Avatar
    Join Date
    Feb 2001
    Location
    California, USA
    Posts
    262
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Gordon,

    Thanks for your reply. I went back and entered the quotes. I'm not impressed by the result which was 3/3/1900 0:00. When I reformatted that to a number, it returned 63.00, not 63.49.

    I guess DATEDIF has its uses, but simple math, properly formatted, seems better to me.


    thanks
    Baumgrenze
    Hier sind wir tief eingewurzelt.

  5. #5
    2 Star Lounger
    Join Date
    Aug 2014
    Posts
    111
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by baumgrenze View Post
    Gordon,

    Thanks for your reply. I went back and entered the quotes. I'm not impressed by the result which was 3/3/1900 0:00. When I reformatted that to a number, it returned 63.00, not 63.49.

    I guess DATEDIF has its uses, but simple math, properly formatted, seems better to me.


    thanks
    The help on Datedif states that it returns the number of "complete" months/days/years/... between the two dates. I guess it depends on what you're after.

    Datedif will take leap years and so on into account whereas doing that with normal maths is a bit trickier.

    https://support.office.com/en-za/art...ad=ZA&fromAR=1

    Regards
    Gordon

  6. #6
    3 Star Lounger baumgrenze's Avatar
    Join Date
    Feb 2001
    Location
    California, USA
    Posts
    262
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Gordon,

    Point well taken.

    Thanks for pointing out the details.
    Baumgrenze
    Hier sind wir tief eingewurzelt.

Posting Permissions

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