| View previous topic :: View next topic |
| Author |
Message |
hotdcdoc Newbie

Joined: 27 May 2008 Posts: 1
|
Posted: Tue May 27, 2008 11:28 am Post subject: Calculate date difference |
|
|
I am trying to get the date difference to display the months and days between dates. ie. 11 months 17 days. Is there something I can add to =MONTHS(A13;D4;0)&" Months " to display the remaining days?
Thanks |
|
| Back to top |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
Posted: Wed May 28, 2008 5:01 am Post subject: |
|
|
Simply substract one date from the other. All dates and times are formatted numbers in unit "Days". _________________ Rest in peace, oooforum.org
Get help on http://forum.openoffice.org |
|
| Back to top |
|
 |
davidh182 OOo Advocate

Joined: 01 Apr 2004 Posts: 413
|
Posted: Thu May 29, 2008 5:03 am Post subject: |
|
|
Not sure this will work -
eg 63 days might be 2 months + 1 days or 2 months+2 days
I think you need to construct the date with the same day number as A13 but less than 1 month from D4 which you can do in a series of cells, or 1 cell like this:
| Code: |
=DAYS(D4;DATE(YEAR(A13);MONTH(A13)+MONTHS(A1;D4;0);DAY(A13)))
|
[If month argument goes above 12 it does helpfully wrap around to the next year] |
|
| Back to top |
|
 |
|