big0
Feb 28 2006, 03:39 PM
Here is my formula:
=Year(A3)-Year(A2)
CELL A3 = 10/8/94
CELL A2 = 02/28/06
The answer I get is 12. The correct answer should be 11 yrs old.
Please assist
big0
freakazeud
Feb 28 2006, 03:45 PM
Hi,
have a look at this detailed
/Working_Out_a_Person's_Age_in_Microsoft_Excel/634.html]tutorial!
It should answer all your questions.
HTH
Good luck
fkegley
Feb 28 2006, 03:51 PM
You're going to have to change your formula to take into account the month and day as well. Here's one way:
=IF(MONTH(A1)>MONTH(A2),YEAR(A1)-YEAR(A2),IF(MONTH(A1)<MONTH(A2),YEAR(A1)-(YEAR(A2)+1),IF(DAY(A1)>DAY(A2),YEAR(A1)-YEAR(A2),YEAR(A1)-(YEAR(A2)+1))))
dannyseager
Feb 28 2006, 03:51 PM
or use this UDF
CODE
Public Function CalcAge(dtDOB As Date) As Integer
CalcAge = DateDiff("yyyy", dtDOB, Date) + (Date < DateSerial(Year(Date), Month([dtDOB]), Day([dtDOB])))
End Function
big0
Feb 28 2006, 04:22 PM
Thanks every one for a quick response.
It works
big0
KingMartin
Feb 28 2006, 04:27 PM
Chip has a day-exact formula for calculating a person's age here:
http://www.cpearson.com/excel/datedif.htm Martin
Luceze
Feb 28 2006, 04:28 PM
You can also use the DATEDIF worksheet function.
=DATEDIF(A3,A2,"Y")
HTH,