Works: How to Add or Subtract Days to or from a Date in a Spreadsheet Cell (242267)



The information in this article applies to:

  • Microsoft Works 2000
  • Microsoft Works 6
  • Microsoft Works Suite 2000
  • Microsoft Works Suite 2001

This article was previously published under Q242267

SUMMARY

This article describes how to add or subtract a specified number of years, months, or days to or from a date in a Works spreadsheet cell.

MORE INFORMATION

To add or subtract a specified number of years, months, or days to or from a date in a Works spreadsheet cell, use the following formula:

=Date(Year(cellref)+years,Month(cellref)+months,Day(cellref)+days)

where years, months, and days are integers, and cellref is a spreadsheet cell reference.

As an example, to find the date that is three years, one month, and five days later than the date stored in cell A1, use the following formula:

=Date(Year(A1)+3,Month(A1)+1,Day(A1)+5)

If cell A1 contains the date "1/1/1989," the formula returns the serial number "33640." This serial number is displayed as "February 6, 1992" when you assign the Time/Date format to the cell that contains the formula.

To assign the Time/Date format to a cell:

  1. Click the cell you want to format.
  2. On the Format menu, click Number.
  3. In the Format box, click Date.
  4. In the Date Options box, select the date format that you prefer.
  5. Click OK.
If the formula returns a string of POUND SIGNS (#), the column is too narrow to display the calculated date. Increase the width of the column.

If the formula returns an "ERR" string, the calculated date probably falls outside of the valid date range for Works. The valid date range for Works is from 1/1/1900 to 6/3/2079.

Modification Type:MinorLast Reviewed:7/15/2004
Keywords:kbhowto kbui KB242267