Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Ned Ludd
 
Posts: n/a
Default Calculate months and years

I want to be able to enter two dates and have the computer provide the number
of months and the number of years to two decimal places. It ought to be easy
but I cannot figure this out.

I have used the YEARFRAC formula and that sort of works...

Except if I put in two dates that are a year apart (July 1, 2004 and June
30, 2005 for example) I do not get 1 year or 12 months. I get fractions in
both instances. Same with July 1 and July 31. That is one month but I get a
fraction.

Even if excel did not recognize that July 1 and July 31 represents exactly 1
month and instead, I had to put August 1 in, I could live with this because I
could just modify the formula but even that does not work.

The Dateif command does not work as it only provides complete months/years
and I need fractions.

Any ideas would be greatly appreciated.


Ned.
  #2   Report Post  
Frank Kabel
 
Posts: n/a
Default

Hi
and how do you want to calculate the fractions. Always based on 30 days
per month?

--
Regards
Frank Kabel
Frankfurt, Germany

"Ned Ludd" schrieb im Newsbeitrag
...
I want to be able to enter two dates and have the computer provide

the number
of months and the number of years to two decimal places. It ought to

be easy
but I cannot figure this out.

I have used the YEARFRAC formula and that sort of works...

Except if I put in two dates that are a year apart (July 1, 2004 and

June
30, 2005 for example) I do not get 1 year or 12 months. I get

fractions in
both instances. Same with July 1 and July 31. That is one month but I

get a
fraction.

Even if excel did not recognize that July 1 and July 31 represents

exactly 1
month and instead, I had to put August 1 in, I could live with this

because I
could just modify the formula but even that does not work.

The Dateif command does not work as it only provides complete

months/years
and I need fractions.

Any ideas would be greatly appreciated.


Ned.


  #3   Report Post  
Ned Ludd
 
Posts: n/a
Default

No. Unfortunately, I would need to calculate fractions based on the days in
the partial month.

So, if I had a period that ran from July 1 to August 15th then I would need
the computer to calculate this as 1.48 months.

July 1 - July 31 = 1 month
August 1 - August 15 = .48 months (ie 15/31 days in August)

I do not know if this can be done. I do appreciate your interest though
Frank and if you can help, I'd appreciate it.

Ned.

"Frank Kabel" wrote:

Hi
and how do you want to calculate the fractions. Always based on 30 days
per month?

--
Regards
Frank Kabel
Frankfurt, Germany

"Ned Ludd" schrieb im Newsbeitrag
...
I want to be able to enter two dates and have the computer provide

the number
of months and the number of years to two decimal places. It ought to

be easy
but I cannot figure this out.

I have used the YEARFRAC formula and that sort of works...

Except if I put in two dates that are a year apart (July 1, 2004 and

June
30, 2005 for example) I do not get 1 year or 12 months. I get

fractions in
both instances. Same with July 1 and July 31. That is one month but I

get a
fraction.

Even if excel did not recognize that July 1 and July 31 represents

exactly 1
month and instead, I had to put August 1 in, I could live with this

because I
could just modify the formula but even that does not work.

The Dateif command does not work as it only provides complete

months/years
and I need fractions.

Any ideas would be greatly appreciated.


Ned.



  #4   Report Post  
Frank Kabel
 
Posts: n/a
Default

Hi
not fully tested but try:
=DATEDIF(A1,B1,"m")-(DAY(A1)-1)/DAY(DATE(YEAR(A1),MONTH(A1)+1,0))+DAY(B
1)/DAY(DATE(YEAR(B1),MONTH(B1)+1,0))

with
A1: starting date
B1: ending date

Could probably be shortened :-)

--
Regards
Frank Kabel
Frankfurt, Germany

"Ned Ludd" schrieb im Newsbeitrag
...
No. Unfortunately, I would need to calculate fractions based on the

days in
the partial month.

So, if I had a period that ran from July 1 to August 15th then I

would need
the computer to calculate this as 1.48 months.

July 1 - July 31 = 1 month
August 1 - August 15 = .48 months (ie 15/31 days in August)

I do not know if this can be done. I do appreciate your interest

though
Frank and if you can help, I'd appreciate it.

Ned.

"Frank Kabel" wrote:

Hi
and how do you want to calculate the fractions. Always based on 30

days
per month?

--
Regards
Frank Kabel
Frankfurt, Germany

"Ned Ludd" schrieb im

Newsbeitrag
...
I want to be able to enter two dates and have the computer

provide
the number
of months and the number of years to two decimal places. It ought

to
be easy
but I cannot figure this out.

I have used the YEARFRAC formula and that sort of works...

Except if I put in two dates that are a year apart (July 1, 2004

and
June
30, 2005 for example) I do not get 1 year or 12 months. I get

fractions in
both instances. Same with July 1 and July 31. That is one month

but I
get a
fraction.

Even if excel did not recognize that July 1 and July 31

represents
exactly 1
month and instead, I had to put August 1 in, I could live with

this
because I
could just modify the formula but even that does not work.

The Dateif command does not work as it only provides complete

months/years
and I need fractions.

Any ideas would be greatly appreciated.


Ned.




  #5   Report Post  
Ned Ludd
 
Posts: n/a
Default

Frank. That is awesome. It works perfectly.

Thank you very much!

Ned.

"Frank Kabel" wrote:

Hi
not fully tested but try:
=DATEDIF(A1,B1,"m")-(DAY(A1)-1)/DAY(DATE(YEAR(A1),MONTH(A1)+1,0))+DAY(B
1)/DAY(DATE(YEAR(B1),MONTH(B1)+1,0))

with
A1: starting date
B1: ending date

Could probably be shortened :-)

--
Regards
Frank Kabel
Frankfurt, Germany

"Ned Ludd" schrieb im Newsbeitrag
...
No. Unfortunately, I would need to calculate fractions based on the

days in
the partial month.

So, if I had a period that ran from July 1 to August 15th then I

would need
the computer to calculate this as 1.48 months.

July 1 - July 31 = 1 month
August 1 - August 15 = .48 months (ie 15/31 days in August)

I do not know if this can be done. I do appreciate your interest

though
Frank and if you can help, I'd appreciate it.

Ned.

"Frank Kabel" wrote:

Hi
and how do you want to calculate the fractions. Always based on 30

days
per month?

--
Regards
Frank Kabel
Frankfurt, Germany

"Ned Ludd" schrieb im

Newsbeitrag
...
I want to be able to enter two dates and have the computer

provide
the number
of months and the number of years to two decimal places. It ought

to
be easy
but I cannot figure this out.

I have used the YEARFRAC formula and that sort of works...

Except if I put in two dates that are a year apart (July 1, 2004

and
June
30, 2005 for example) I do not get 1 year or 12 months. I get
fractions in
both instances. Same with July 1 and July 31. That is one month

but I
get a
fraction.

Even if excel did not recognize that July 1 and July 31

represents
exactly 1
month and instead, I had to put August 1 in, I could live with

this
because I
could just modify the formula but even that does not work.

The Dateif command does not work as it only provides complete
months/years
and I need fractions.

Any ideas would be greatly appreciated.


Ned.






  #6   Report Post  
Frank Kabel
 
Posts: n/a
Default

Hi
thanks for your reply. Still think the formula could be simplified :-)

--
Regards
Frank Kabel
Frankfurt, Germany

Ned Ludd wrote:
Frank. That is awesome. It works perfectly.

Thank you very much!

Ned.

"Frank Kabel" wrote:

Hi
not fully tested but try:
=DATEDIF(A1,B1,"m")-(DAY(A1)-1)/DAY(DATE(YEAR(A1),MONTH(A1)+1,0))+DAY(B
1)/DAY(DATE(YEAR(B1),MONTH(B1)+1,0))

with
A1: starting date
B1: ending date

Could probably be shortened :-)

--
Regards
Frank Kabel
Frankfurt, Germany

"Ned Ludd" schrieb im Newsbeitrag
...
No. Unfortunately, I would need to calculate fractions based on the
days in the partial month.

So, if I had a period that ran from July 1 to August 15th then I
would need the computer to calculate this as 1.48 months.

July 1 - July 31 = 1 month
August 1 - August 15 = .48 months (ie 15/31 days in August)

I do not know if this can be done. I do appreciate your interest
though Frank and if you can help, I'd appreciate it.

Ned.

"Frank Kabel" wrote:

Hi
and how do you want to calculate the fractions. Always based on 30
days per month?

--
Regards
Frank Kabel
Frankfurt, Germany

"Ned Ludd" schrieb im
Newsbeitrag
...
I want to be able to enter two dates and have the computer
provide the number of months and the number of years to two
decimal places. It ought to be easy but I cannot figure this out.

I have used the YEARFRAC formula and that sort of works...

Except if I put in two dates that are a year apart (July 1, 2004
and June 30, 2005 for example) I do not get 1 year or 12 months.
I get fractions in both instances. Same with July 1 and July 31.
That is one month but I get a fraction.

Even if excel did not recognize that July 1 and July 31
represents exactly 1 month and instead, I had to put August 1 in,
I could live with this because I could just modify the formula
but even that does not work.

The Dateif command does not work as it only provides complete
months/years and I need fractions.

Any ideas would be greatly appreciated.


Ned.



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
how can I calculate chronological age in excel Mike New Excel Discussion (Misc queries) 7 April 25th 23 11:45 AM
How do I display months and years between two dates JSmith Excel Discussion (Misc queries) 1 November 30th 04 04:41 PM


All times are GMT +1. The time now is 10:51 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"