ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Months (https://www.excelbanter.com/excel-discussion-misc-queries/202849-months.html)

Jose

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

Peo Sjoblom[_2_]

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




Niek Otten

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



joel

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


Peo Sjoblom[_2_]

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






Jose

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



All times are GMT +1. The time now is 11:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com