Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculating Age Between Two Dates

Status
Not open for further replies.

shelby55

Technical User
Jun 27, 2003
1,229
CA
Hello

I have a table with the patient's birthdate and admit date and want to calculate their date at time of admission.

I can get it if the patient's year of birth is in the same year as the admission:
=IF(YEAR(U2)=YEAR(F2),MONTH(F2)-MONTH(U2))/12

I can also get it if the year is not the same:
=IF(YEAR(U5)<>YEAR(F5),(YEAR(U5)-YEAR(F5))+(MONTH(U5)-MONTH(F5))/12)

But for some reason I am having difficulty combining the two IF statements to one so that I only have to do the calc for one column.

Any and all help greatly appreciated.

Shelby
 
Hi

Never mind - should have checked FAQ first where Skip posted excellent article about dates and a function that isnt't readily referenced.

So I just used:
=DATEDIF(bdate,admdate,"y")

and it worked perfectly.

Thanks Skip!!


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top