Calculate age with an end date

P

punkrawk_99

I am currently using the formula =DATEDIF(J5,TODAY(),"y")&" years
"&DATEDIF(J5,TODAY(),"ym")&" months "&DATEDIF(J5,TODAY(),"md")&" days" to
calculate the length of time I have a cigar in a humidor. The start date is
in column J and the age displays in column K. What do I need to add so that
when I put an end date in column L (the date the cigar is smoked), the age
displays just the length of time between the dates?
 
F

FloMM2

Punkrawk_99,
My solution is as follows:
First format "L" column as Date and time (i.e. 5/6/08 13:00)
Edit your formula as follows; "=IF(L5="",DATEDIF(J5,TODAY(),"y")&" years
"&DATEDIF(J5,TODAY(),"ym")&" months
"&DATEDIF(J5,TODAY(),"md")&"days",DATEDIF(J5,L5,"y")&" years
"&DATEDIF(J5,L5,"ym")&" months "&DATEDIF(J5,L5,"md")&"days")"

What this does is look at the cell in column L, if there is nothing in it.
It calculates how long the cigar has been in the humidor.
If the entry in "L5" is a date, it calculates from that date.

P.S.
It is a little more involved than T. Valko, but it also works.
 
P

punkrawk_99

Thanks. I got it working.

FloMM2 said:
Punkrawk_99,
My solution is as follows:
First format "L" column as Date and time (i.e. 5/6/08 13:00)
Edit your formula as follows; "=IF(L5="",DATEDIF(J5,TODAY(),"y")&" years
"&DATEDIF(J5,TODAY(),"ym")&" months
"&DATEDIF(J5,TODAY(),"md")&"days",DATEDIF(J5,L5,"y")&" years
"&DATEDIF(J5,L5,"ym")&" months "&DATEDIF(J5,L5,"md")&"days")"

What this does is look at the cell in column L, if there is nothing in it.
It calculates how long the cigar has been in the humidor.
If the entry in "L5" is a date, it calculates from that date.

P.S.
It is a little more involved than T. Valko, but it also works.
 

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