Friday, April 17, 2015

Monthly Date Increase in Calc

To increase the date by a month in a series in LibreOffice's Calc spreadsheet program there are different options depending on the particular date that is to be increased.

To increment most dates  (e.g. January 12, 2000; February 12, 2000; March 12, 2000; etc.)
  1. Input the first date in the series in a cell, for example cell A1
  2. In the cell underneath it (i.e. cell B1) input the following formula referencing the cell above: =DATE(YEAR(A1),MONTH(A1)+1,DAY(A1))
  3. Click on the cell with the formula and then drag the bottom left corner handle down to fill the column with monthly incremented dates
To increase dates at the end of the month (e.g.  January 31, 2000; February 29, 2000; March 31, 2000) a little more finesse is required. Follow the above procedure but change the formula to the following:

=DATE(YEAR(A1),MONTH(A1)+2,0)

To better understanding what is going on:
 =DATE(YEAR(A1),MONTH(A1),0) ends up referring to the last day of the previous month
 =DATE(YEAR(A1),MONTH(A1)+1,0) ends up referring to the last day of the current month
 =DATE(YEAR(A1),MONTH(A1)+2,0) ends up referring to the last day of the next month



No comments:

Post a Comment