Consulting

Results 1 to 5 of 5

Thread: Solved: Date Difference YY-MM-WW-DD-HH-MM-SS

  1. #1

    Solved: Date Difference YY-MM-WW-DD-HH-MM-SS

    Hi all,
    I have NOW() in cell A1 and 16-06-1960 in Cell A2.
    I like to get the difference in the following format, please:
    Years?Months-Weeks-Days-Hours-Minutes-Seconds
    Any thoughts?
    Best,
    Wolfgang

  2. #2
    Knowledge Base Approver VBAX Master Oorang's Avatar
    Joined
    Jan 2007
    Posts
    1,135
    Location
    I don't believe the format command has any syntax for Weeks, However the rest is just: yyyy-mm-dd-hh-mm-ss
    Cordially,
    Aaron



    Keep Our Board Clean!
    • Please Mark your thread "Solved" if you get an acceptable response (under thread tools).
    • Enclose your code in VBA tags then it will be formatted as per the VBIDE to improve readability.

  3. #3
    Good Morning Aaron,

    thank you very much for your reply.

    That's what I was afraid of...

    Can it be done using VBA?

    Best,
    Wolfgang

  4. #4
    Knowledge Base Approver VBAX Master Oorang's Avatar
    Joined
    Jan 2007
    Posts
    1,135
    Location
    This will get you everything you need but weeks with no fuss: http://www.cpearson.com/excel/datedif.htm

    Personally to get week, I would just do: (date1 - date2)/7
    Then format as: 0" Weeks"
    Cordially,
    Aaron



    Keep Our Board Clean!
    • Please Mark your thread "Solved" if you get an acceptable response (under thread tools).
    • Enclose your code in VBA tags then it will be formatted as per the VBIDE to improve readability.

  5. #5
    Hi Aaron,

    thank you for your kind help.

    Best,
    Wolfgang

Posting Permissions

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