View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Reitanos Reitanos is offline
external usenet poster
 
Posts: 123
Default Excel formula calculating age

I don't think I have any typos in there :p

Here's your code modified:
=IF(DATEDIF(B2, TODAY(),"y")=0,"",DATEDIF(B2, TODAY(),"y")&" years,
")&IF(AND(DATEDIF(B2, TODAY(),"y")=0,DATEDIF(B2,
TODAY(),"m")=0),"",DATEDIF(B2,
TODAY(),"ym")&" months, ")&DATEDIF(B2, TODAY(),"md")&" days"

On Apr 28, 1:24 pm, wrote:
I'm currently using the formula =INT((TODAY()-B2/365.25) to calculate
age in years. Is there a formula that will show age in months only,
if under 1 year, and age in days only, if under 1 month? I used
=DATEDIF(birthdate, TODAY(),"y")&"years"&DATEDIF(birthdate,
TODAY(),"ym")&"months"&DATEDIF(birthdate, TODAY(),"md")&"days" but I
only want years or months or days to show.

Thanks