changed DOB to age, but if no DOB need cell to be empty.

M

melcook1

I am using this formula: in Excel 2007
=DATEDIF(A1,TODAY(),"y") & " years, " & DATEDIF(A1,TODAY(),"ym") & " months,
" & DATEDIF(A1,TODAY(),"md") & " days"

will give age. for example if A1 contains:
1/15/1985
the formula will return in A2
21 years, 8 months, 15 days

Question: If I don't have a date in A1 what do I need to add to formula to
keep A2 blank until a date is added to A1?

I would also like to color code the age broke down in ranges birth-4 months,
5-8 months, 9-12 months, 1yr, 2yr,3 yr, 4yr and 5 years old. So that it
changes as they age. Is this possible?

Thanks in advance
 
M

melcook1

I was hoping you would answer becasue it was you who wrote the formula I am
using. Now I'm confused with , do I add this to the orginal formula? If soI
am getting a error in doing so.
 
G

Gary''s Student

Try this:

"=IF(A1="""","""",DATEDIF(A1,TODAY(),""y"")&"" years,
""&DATEDIF(A1,TODAY(),""ym"")&"" months,
""&DATEDIF(A1,TODAY(),""md"")&"" days"")"

just be careful of the text wrapping.
 
B

Bill Sharpe

Gary''s Student said:
Try this:

"=IF(A1="""","""",DATEDIF(A1,TODAY(),""y"")&"" years,
""&DATEDIF(A1,TODAY(),""ym"")&"" months,
""&DATEDIF(A1,TODAY(),""md"")&"" days"")"

just be careful of the text wrapping.
If you are really Gary's Student, Gary did an excellent job!

Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top