How to add month to date in LibreOffice calc
=edate(a1;1)
edate
returns the date that is the specified number of months after or before the specified date.- First argument of edate :start date.
- Second argument of edate : number of month. If negative, edate calculates the date before.
The currently favored answer will skip short months that follow long ones
Set A1=2014-01-31 Then the result using =DATE(YEAR(A1), MONTH(A1)+1, DAY(A1)) will be 2014-03-03, thus skipping February.
The EDATE approach suggested above loses days
Short months cause EDATE to drop days for successive months. E.g. =EDATE(DATE(2014,1,31),1) does produce 2014-02-28, but applying it again results in 2014-03-28, which is not the last day in March.
A solution that does work: increment months with the day set to zero
Set the day to zero, and increment months, while being one month ahead. E.g. To start in January use DATE(2014,2,0) => 2014-01-31 then DATE(2014,3,0) => 2014-02-28, then DATE(2014,4,0) -> 2014-03-31 as one would expect by logically following the last day of each month.
Other approaches
Adjustments can be made if you want the last working day in the month, or 30 day increments while not skipping months, etc. Depends on the objective.
As given in reference: Date Arithmetic, this adds one to the month:
=DATE(YEAR(A1), MONTH(A1)+1, DAY(A1))