#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Excel Date Display?

Hello
Let's Suppose i gave some date 01-01-2007 in cell A1 and 01-05-2010 in cell b1

if i Subtract Cell B1 from A1 so the Answer will be 1100 Days BUT

i want these days as date like 6 days 1 months and 3 Years

OR

01/06/03


Is it Possible ?
Please Help
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Excel Date Display?

Try this with the earlier date in A1

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

For an explanation of datedif look here
http://www.cpearson.com/excel/datedif.aspx

and for the occasions when it can go wrong look here
http://www.microsoft.com/office/comm...23f&sloc=en-us

Mike

"Naveeddil" wrote:

Hello
Let's Suppose i gave some date 01-01-2007 in cell A1 and 01-05-2010 in cell b1

if i Subtract Cell B1 from A1 so the Answer will be 1100 Days BUT

i want these days as date like 6 days 1 months and 3 Years

OR

01/06/03


Is it Possible ?
Please Help

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Excel Date Display?

On Sat, 17 May 2008 02:17:00 -0700, Naveeddil
wrote:

Hello
Let's Suppose i gave some date 01-01-2007 in cell A1 and 01-05-2010 in cell b1

if i Subtract Cell B1 from A1 so the Answer will be 1100 Days BUT

i want these days as date like 6 days 1 months and 3 Years

OR

01/06/03


Is it Possible ?
Please Help


It is possible but difficult because of the variable numbers of days in a month
and in a year. Days and Weeks are more precise

So you need to be very specific on what you require.

For example, the formula Mike posted, which usually works, sometimes doesn't:

31-Jan-2008 29-Feb-2008 -- 0 years 0 months 27 days
Should be 29 days

31-Jan-2007 28-Feb-2007 -- 0 years 0 months 25 days
Should be 25 days

29-Feb-2008 1-Mar-2008 -- 0 years 0 months 3 days
This should be one (1) day

If you just need approximations, then the formula probably works most of the
time, especially if your starting date is not at the end of the month.
--ron
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Excel Date Display?

Ron,

I agree and gave a link to a thread that pointed out those anomolies but the
real point for me is why anyone wants to include months in an age calculation
in the first place because the varying length makes it a meaningless number.

I may be wrong but my guess is that Microsoft never documented datedif in
Excel because it's quite the silliest function they ever produced.

Mike

"Ron Rosenfeld" wrote:

On Sat, 17 May 2008 02:17:00 -0700, Naveeddil
wrote:

Hello
Let's Suppose i gave some date 01-01-2007 in cell A1 and 01-05-2010 in cell b1

if i Subtract Cell B1 from A1 so the Answer will be 1100 Days BUT

i want these days as date like 6 days 1 months and 3 Years

OR

01/06/03


Is it Possible ?
Please Help


It is possible but difficult because of the variable numbers of days in a month
and in a year. Days and Weeks are more precise

So you need to be very specific on what you require.

For example, the formula Mike posted, which usually works, sometimes doesn't:

31-Jan-2008 29-Feb-2008 -- 0 years 0 months 27 days
Should be 29 days

31-Jan-2007 28-Feb-2007 -- 0 years 0 months 25 days
Should be 25 days

29-Feb-2008 1-Mar-2008 -- 0 years 0 months 3 days
This should be one (1) day

If you just need approximations, then the formula probably works most of the
time, especially if your starting date is not at the end of the month.
--ron

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Excel Date Display?

On Sat, 17 May 2008 03:59:00 -0700, Mike H
wrote:

Ron,

I agree and gave a link to a thread that pointed out those anomolies but the
real point for me is why anyone wants to include months in an age calculation
in the first place because the varying length makes it a meaningless number.

I may be wrong but my guess is that Microsoft never documented datedif in
Excel because it's quite the silliest function they ever produced.

Mike


Well, it can certainly give inconsistent results.

--ron


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,389
Default Excel Date Display?

You may be right Mike, but it still doesn't absolve Microsoft. As you can
see by the post, people want to express age differences in months. You see
it on TV all the time. By producing the function, Microsoft was simply
responding to customer demand. If they are going to produce it, they should
document it.

Regards,
Fred.

"Mike H" wrote in message
...
Ron,

I agree and gave a link to a thread that pointed out those anomolies but
the
real point for me is why anyone wants to include months in an age
calculation
in the first place because the varying length makes it a meaningless
number.

I may be wrong but my guess is that Microsoft never documented datedif in
Excel because it's quite the silliest function they ever produced.

Mike

"Ron Rosenfeld" wrote:

On Sat, 17 May 2008 02:17:00 -0700, Naveeddil
wrote:

Hello
Let's Suppose i gave some date 01-01-2007 in cell A1 and 01-05-2010 in
cell b1

if i Subtract Cell B1 from A1 so the Answer will be 1100 Days BUT

i want these days as date like 6 days 1 months and 3 Years

OR

01/06/03


Is it Possible ?
Please Help


It is possible but difficult because of the variable numbers of days in a
month
and in a year. Days and Weeks are more precise

So you need to be very specific on what you require.

For example, the formula Mike posted, which usually works, sometimes
doesn't:

31-Jan-2008 29-Feb-2008 -- 0 years 0 months 27 days
Should be 29 days

31-Jan-2007 28-Feb-2007 -- 0 years 0 months 25 days
Should be 25 days

29-Feb-2008 1-Mar-2008 -- 0 years 0 months 3 days
This should be one (1) day

If you just need approximations, then the formula probably works most of
the
time, especially if your starting date is not at the end of the month.
--ron


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 287
Default Excel Date Display?

Hello Ron,

For the 3 examples you gave Mike's formula gives me 29, 28 and 1 day
respectively which appear to me to be correct, although I think you get odd
results if start date is 31st January and end date 1st March.....in which
case try this formula

=YEAR(B1)-YEAR(A1)-(TEXT(B1,"mmdd")< TEXT(A1,"mmdd"))&" years
"&MOD(MONTH(B1)-MONTH(A1)-(DAY(B1)< DAY(A1)),12)&" months
"&B1-MIN(DATE(YEAR(B1),MONTH(B1)-(DAY(B1)< DAY(A1))+{1,0},DAY(A1)*{0,1}))&"
days"



"Ron Rosenfeld" wrote:

On Sat, 17 May 2008 02:17:00 -0700, Naveeddil
wrote:

Hello
Let's Suppose i gave some date 01-01-2007 in cell A1 and 01-05-2010 in cell b1

if i Subtract Cell B1 from A1 so the Answer will be 1100 Days BUT

i want these days as date like 6 days 1 months and 3 Years

OR

01/06/03


Is it Possible ?
Please Help


It is possible but difficult because of the variable numbers of days in a month
and in a year. Days and Weeks are more precise

So you need to be very specific on what you require.

For example, the formula Mike posted, which usually works, sometimes doesn't:

31-Jan-2008 29-Feb-2008 -- 0 years 0 months 27 days
Should be 29 days

31-Jan-2007 28-Feb-2007 -- 0 years 0 months 25 days
Should be 25 days

29-Feb-2008 1-Mar-2008 -- 0 years 0 months 3 days
This should be one (1) day

If you just need approximations, then the formula probably works most of the
time, especially if your starting date is not at the end of the month.
--ron

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Excel Date Display?

On Sat, 17 May 2008 12:31:01 -0700, daddylonglegs
wrote:

Hello Ron,

For the 3 examples you gave Mike's formula gives me 29, 28 and 1 day
respectively which appear to me to be correct, although I think you get odd
results if start date is 31st January and end date 1st March.....in which
case try this formula


Those are odd results, since I get something quite different. Something
strange is going on.

Obviously you didn't copy and paste your results, since Mike's formula gives a
string.

Here is what I get -- copied and pasted:

A B C
31-Jan-2008 29-Feb-2008 0 years 0 months 27 days
31-Jan-2007 28-Feb-2007 0 years 0 months 25 days
29-Feb-2008 1-Mar-2008 0 years 0 months 3 days

With Mike's formula, also copied and pasted (but dragged down from C1):

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

It'll be very interesting if this function gives different results in different
versions of Excel. I'm using Excel 2007

I think you get odd results if start date is 31st January and end date 1st March


Here's what I get using Mike's formula:

31-Jan-2008 1-Mar-2008 0 years 1 months 1 days

That seems like a perfectly reasonable answer. And it is also the same as the
answer I get using your formula.

--ron
  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,819
Default Excel Date Display?

Hello,

You may not subtract the later date from an earlier date. It will make a
negative number.

Naveeddil wrote:

Hello
Let's Suppose i gave some date 01-01-2007 in cell A1 and 01-05-2010 in cell b1

if i Subtract Cell B1 from A1 so the Answer will be 1100 Days BUT

i want these days as date like 6 days 1 months and 3 Years

OR

01/06/03


Is it Possible ?
Please Help


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 date format, NOT JUST DISPLAY !! Khaleel Excel Worksheet Functions 3 June 25th 07 09:43 AM
display extension for date in excel phil Excel Discussion (Misc queries) 8 November 14th 06 08:24 PM
Excel 2003: date display issue Andrew Excel Discussion (Misc queries) 17 July 13th 06 05:36 PM
Display Last Saved Date Excel JonniP Excel Discussion (Misc queries) 1 October 6th 05 02:58 PM
How do I display the last saved date in an EXCEL spreadsheet? Andrea Excel Discussion (Misc queries) 1 March 10th 05 08:55 PM


All times are GMT +1. The time now is 12:44 PM.

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

About Us

"It's about Microsoft Excel"