Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Calculate age with an end date

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?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Calculate age with an end date

Replace each instance of TODAY() with:

IF(L5="",TODAY(),L5)

--
Biff
Microsoft Excel MVP


"punkrawk_99" wrote in message
...
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?



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 207
Default Calculate age with an end date

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.

"punkrawk_99" wrote:

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?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Calculate age with an end date

Thanks. I got it working.

"FloMM2" wrote:

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.

"punkrawk_99" wrote:

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?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to calculate end date using order date and lead time variab BWA Excel Worksheet Functions 3 August 15th 08 04:48 PM
Tricky Date calculation: How to calculate a future date [email protected] Excel Discussion (Misc queries) 9 August 11th 06 04:24 AM
Auto calculate for date + days forward to yield new date John Sullivan Excel Worksheet Functions 1 April 22nd 06 05:18 PM
formula to calculate age using birth date and current date lalah Excel Worksheet Functions 2 November 20th 05 10:51 PM
formula to calculate future date from date in cell plus days Chicesq Excel Worksheet Functions 8 November 3rd 05 12:25 PM


All times are GMT +1. The time now is 08:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"