Article ID: 131734 - Last Review: January 19, 2007 - Revision: 3.1

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

This article was previously published under Q131734

On This Page

Expand all | Collapse all

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(<fieldname><>"",INT((NOW()-<fieldname>)/365.24),"")
where <fieldname> 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.)
				

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
Keywords: 
kbhowto kbui KB131734
Retired KB ArticleRetired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
 

Article Translations

 

Related Support Centers