Microsoft KB Archive/107189

= Works: Adding Days to a Date in the Spreadsheet =

Article ID: 107189

Article Last Modified on 11/15/2004

-

APPLIES TO


 * Microsoft Works 3.0 Standard Edition
 * Microsoft Works 3.0a
 * Microsoft Works 3.0b
 * Microsoft Works 4.5 Standard Edition
 * Microsoft Works 4.5a
 * Microsoft Works 4.0 Standard Edition
 * Microsoft Works 4.0a

-



This article was previously published under Q107189





SUMMARY
To add or subtract a certain number of years, months, and/or days to a date in a Works spreadsheet, use the following formula:

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

In the above formula, the years, months, and days are integers, and "ref" is a spreadsheet cell reference. If the formula returns an "ERR", the resulting date is probably out of the valid date range for Works, which is 1/1/1900 to 6/3/2079.



MORE INFORMATION
For example, if cell A1 contains the date 1/1/89, use the following formula to find the date 3 years, 1 month, and 5 days later:

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

The result of this formula is the serial number 33640. It displays as "February 6, 1992" when you select the Time/Date format using the following steps:


 * 1) From the Format menu, click Number.
 * 2) In the Format box, click Date.
 * 3) In the Date Options box, select the date format you prefer.
 * 4) Choose OK.

NOTE: If the date appears as "#" signs in the spreadsheet, you need to increase the width of the column to display the date.

