Microsoft KB Archive/131734

= Works: Calculating an Age from a Date in Database or Spreadsheet =

Article ID: 131734

Article Last Modified on 1/19/2007

-

APPLIES TO


 * Microsoft Works 6.0
 * Microsoft Works 2000 Standard Edition
 * Microsoft Works 3.0 Standard Edition
 * Microsoft Works 4.0 Standard Edition
 * Microsoft Works 4.5 Standard Edition

-



This article was previously published under Q131734



SUMMARY
In the Spreadsheet and Database modules of Works for Windows, it is possible to calculate a person's age based on the current date and a date that has been entered into a database field or spreadsheet cell.



MORE INFORMATION
The following formula will calculate a person's age from information that has been entered as a date

=IF( <>"",INT((NOW- )/365.24),"")

where is either the name of the field or the cell reference containing the birth date. See below for both a database and a spreadsheet example.

NOTE: It is important to type two double quotation marks ("") next to each other, without a space in between the quotation marks. If there is a space, Works 4.0 or later will calculate a different answer, due to its ability to distinguish between an actual blank and a space.

Database Example
In the example below, BDate is the birthdate and AgeNow is the person's current age.     BDate       AgeNow

1   1/1/70   =IF(BDate<>"",INT((NOW-BDate)/365.24),"") For example, if the current date is 9/1/95, this will display (in list view):     BDate        AgeNow

1   1/1/70         25 2    3/15/65        30 3                        >---(BDate is blank so AgeNow is also blank.) 4   2/10/61        34

Spreadsheet Example
      A          B

1   1/1/70   =IF(A1<>"",INT((NOW-A1)/365.24),"") If the current date is 9/1/95, this will display:       A          B       (Highlight the cells in column B as far down as 1    1/1/70       25       you want the formula repeated, and then                           click Fill Down on the Edit menu.)

Additional query words: 3.00 4.00 4.00a 4.50 w_works works2k work6 years old birthday birthdate

Keywords: kbhowto kbui KB131734

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.