#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35
Default Months

I have the following problem with dates:
C3 D3
01/08/2008 31/11/2009


When I ask D3-C3 I get 5 instead of 18. How am I doing wrong?
--
Many thanks for your help,
Jose
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 964
Default Months

What are those dates supposed to be?

1. How can you expect to get 18 regardless and how can you get 5?

2. 31/11/2009 or 11/31/2009 US date format is a non-existent date, so that
will be a text string. There are only 30 days in November

Assume it was 11/30/2009

then the result would be

486 assuming that 01/08/2008 is the first of August 2008, if you are mixing
date format and
the first is US format and Jan 8 2008m then the difference would be 692

--


Regards,


Peo Sjoblom

"Jose" wrote in message
...
I have the following problem with dates:
C3 D3
01/08/2008 31/11/2009


When I ask D3-C3 I get 5 instead of 18. How am I doing wrong?
--
Many thanks for your help,
Jose



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 964
Default Months

Sorry, didn't see your subject, use

=DATEDIF(earlier_date_later_date,"m")


but your date is still wrong, November has only 30 days and
if you mean 11/30/08 then it would be 15 months

and finally if you want to disregard the year you can use

=DATEDIF(C3,D3,"ym")

--


Regards,


Peo Sjoblom

"Peo Sjoblom" wrote in message
...
What are those dates supposed to be?

1. How can you expect to get 18 regardless and how can you get 5?

2. 31/11/2009 or 11/31/2009 US date format is a non-existent date, so that
will be a text string. There are only 30 days in November

Assume it was 11/30/2009

then the result would be

486 assuming that 01/08/2008 is the first of August 2008, if you are
mixing date format and
the first is US format and Jan 8 2008m then the difference would be 692

--


Regards,


Peo Sjoblom

"Jose" wrote in message
...
I have the following problem with dates:
C3 D3
01/08/2008 31/11/2009


When I ask D3-C3 I get 5 instead of 18. How am I doing wrong?
--
Many thanks for your help,
Jose





  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,440
Default Months

Hi Jose,

I'm surprised you get anything at all, because according to Excel 31/11/2009 is not a valid date.
But I can't understand why you expect 18 as a result.
What is your formula?

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Jose" wrote in message ...
|I have the following problem with dates:
| C3 D3
| 01/08/2008 31/11/2009
|
|
| When I ask D3-C3 I get 5 instead of 18. How am I doing wrong?
| --
| Many thanks for your help,
| Jose


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Months

You need to include the year

=12*(Year(D3)-Year(C3))+Month(D3)-Month(C3)

"Jose" wrote:

I have the following problem with dates:
C3 D3
01/08/2008 31/11/2009


When I ask D3-C3 I get 5 instead of 18. How am I doing wrong?
--
Many thanks for your help,
Jose



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35
Default Months

Sorry, I made some typos.
DATE 1: 01/08/2008
DATE2: 31/12/2009

Total months 17
--
Many thanks for your help,
Jose


"Joel" wrote:

You need to include the year

=12*(Year(D3)-Year(C3))+Month(D3)-Month(C3)

"Jose" wrote:

I have the following problem with dates:
C3 D3
01/08/2008 31/11/2009


When I ask D3-C3 I get 5 instead of 18. How am I doing wrong?
--
Many thanks for your help,
Jose

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
Calculating months with half months. adelaide Excel Discussion (Misc queries) 1 June 6th 08 08:36 PM
3 months prior and 3 months post a date renee Excel Worksheet Functions 2 May 2nd 08 05:46 PM
Adding months to dates should account for 28-30-31 day months Graham Excel Worksheet Functions 3 February 1st 06 12:06 PM
converting months to years and months??? Marty Excel Discussion (Misc queries) 1 February 18th 05 02:38 AM
How do i change 15 months to read 1 year and 3 months? Marty Excel Discussion (Misc queries) 1 February 17th 05 11:21 PM


All times are GMT +1. The time now is 07:58 AM.

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"