Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
rmriba
 
Posts: n/a
Default CONVERTING TIME (DAYS) TO ONTHS,YEARS, ETC.

Hello, Gurus:

I have multiple licenses (potentially 50+), each one with an expiration
date. I have a sheet with expiration date column and another column
with the difference between expiration date and current date. The
display shows the result in days.

I would like it to show it in years-months-days format. Excel has a
similar function for converting to hrs, sec, etc., but no such beauty
(apparently) for this case. Any help will be appreciated.

  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

Maybe you could use =datedif()

You can find lots of info at Chip Pearson's site:
http://www.cpearson.com/excel/datedif.htm

(=datedif() was only documented in xl2k's help.)

"rmriba" wrote:

Hello, Gurus:

I have multiple licenses (potentially 50+), each one with an expiration
date. I have a sheet with expiration date column and another column
with the difference between expiration date and current date. The
display shows the result in days.

I would like it to show it in years-months-days format. Excel has a
similar function for converting to hrs, sec, etc., but no such beauty
(apparently) for this case. Any help will be appreciated.


--

Dave Peterson
  #3   Report Post  
Adam Molinaro
 
Posts: n/a
Default

This is kind of clunky, so there might be simpler/slicker ways of doing it,
but you could use the TEXT function. You could do the subtraction of dates
to get your years, months, and days separately, then putting them all
together (with a separating character; I used a dash).

Let's suppose your first date is in D9 (9/26/2005), and your second date is
in D15 (5/9/2003). Enter the following formula:

=TEXT(D9,"yyyy")-TEXT(D15,"yyyy")&"-"&TEXT(D9,"mm")-TEXT(D15,"mm")&"-"&TEXT(D9,"dd")-TEXT(D15,"dd"). Your output would be:
2-4-17 (years - months - days).

The & concatenates/combines the formulae, and the "-" puts in the separators.

You could also put them in separate cells. For example,
=TEXT(D9,"YYYY")-TEXT(D15,"YYYY) would yield simply '2.'

HTH.

Adam.

"Dave Peterson" wrote:

Maybe you could use =datedif()

You can find lots of info at Chip Pearson's site:
http://www.cpearson.com/excel/datedif.htm

(=datedif() was only documented in xl2k's help.)

"rmriba" wrote:

Hello, Gurus:

I have multiple licenses (potentially 50+), each one with an expiration
date. I have a sheet with expiration date column and another column
with the difference between expiration date and current date. The
display shows the result in days.

I would like it to show it in years-months-days format. Excel has a
similar function for converting to hrs, sec, etc., but no such beauty
(apparently) for this case. Any help will be appreciated.


--

Dave Peterson

  #4   Report Post  
rmriba
 
Posts: n/a
Default

Much appreciated, both of you. It worked like a charm.

rmriba wrote:
Hello, Gurus:

I have multiple licenses (potentially 50+), each one with an expiration
date. I have a sheet with expiration date column and another column
with the difference between expiration date and current date. The
display shows the result in days.

I would like it to show it in years-months-days format. Excel has a
similar function for converting to hrs, sec, etc., but no such beauty
(apparently) for this case. Any help will be appreciated.


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
Excel Time Manipulation BFiedler Excel Discussion (Misc queries) 0 September 15th 05 01:15 AM
conditional formatting with time values Access Idiot Excel Discussion (Misc queries) 2 September 13th 05 03:29 PM
Keep number format after converting time to text DH Excel Discussion (Misc queries) 2 April 28th 05 07:18 PM
Converting sum of time Tanya Excel Worksheet Functions 4 April 22nd 05 04:32 AM
Time - converting HH:MM:SS to Minutes Noel S Pamfree Excel Worksheet Functions 3 January 8th 05 04:26 PM


All times are GMT +1. The time now is 10:03 PM.

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"