Weekly Computer Tip # 22
13 July 2003


Calculating a person's age
(Microsoft

Did you know ...

you can use Excel's DATEDIF worksheet function to calculate somebody's age based on date of birth?

Here's how:

  1. Enter the person's date of birth in, say, cell A1
  2. Select the cell in which the age is to appear (say, B1) and enter the following formula: =DATEDIF(A1, TODAY(), "y")
  3. Press ENTER

Using Excel's AutoFill feature, you can then quickly enter the formula into a range of cells. Here's how:

  1. Enter other dates in, say, cell A2, A3, A4, A5
  2. Select cell B1
  3. Point to the fill handle (the small black square) in the lower-right corner of cell B1. The mouse pointer will appear as a thin black cross when it is properly positioned
  4. Press and hold down the mouse button, and drag the fill handle to cell B5
  5. Then release the mouse button

The selected range is filled with the calculated age based on the date of birth in cell A1, A2, A3, A4 and A5.

.