PDA

View Full Version : Solved: Date Difference YY-MM-WW-DD-HH-MM-SS



Wolfgang
10-09-2007, 12:45 PM
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

Oorang
10-09-2007, 01:16 PM
I don't believe the format command has any syntax for Weeks, However the rest is just: yyyy-mm-dd-hh-mm-ss

Wolfgang
10-09-2007, 11:47 PM
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

Oorang
10-10-2007, 06:28 AM
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"

Wolfgang
10-11-2007, 05:52 AM
Hi Aaron,

thank you for your kind help.

Best,
Wolfgang