Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default calculate fractions using dates

I would like to calculate the fractions of various grants that can be spent
this fiscal year. Some of the projects start this year, some started before
this year, other projects end this year, some projects continue after this
year, and others both start and end this year.

I have figured out how to calculate the total months in the grant using
DATEDIF. However, I don't know how to calculate the number of months for
this year.

To calculate the months for this fiscal year, I could also use DATEDIF. The
first date would be either June 30, 2008 or the project start date depending
on which is later. Likewise, the second date would be July 1, 2009 or the
project end date, whichever is earlier. How would the formula automatically
select the correct dates?

Do I seem to be on the right track?

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default calculate fractions using dates

Use the MIN and MAX functions...

=MAX(--"6/30/2008",A1)

=MIN(--"7/1/2009",A1)

--
Rick (MVP - Excel)


"lemonscented" wrote in message
...
I would like to calculate the fractions of various grants that can be spent
this fiscal year. Some of the projects start this year, some started
before
this year, other projects end this year, some projects continue after this
year, and others both start and end this year.

I have figured out how to calculate the total months in the grant using
DATEDIF. However, I don't know how to calculate the number of months for
this year.

To calculate the months for this fiscal year, I could also use DATEDIF.
The
first date would be either June 30, 2008 or the project start date
depending
on which is later. Likewise, the second date would be July 1, 2009 or the
project end date, whichever is earlier. How would the formula
automatically
select the correct dates?

Do I seem to be on the right track?


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default calculate fractions using dates

Thank you. That gets me started.

However, I don't know what the 2 hyphens (--)in the formula represent.
I tried to follow your recommendation and came up with this but it is not
correct-the answer is too large. Any suggestions?

=DATEDIF((MIN((D3),"6/30/2008")),(MAX((E3),"7/1/2009")),"m")/(DATEDIF(D3,E3,"m"))

My apologies if this question is too detailed. I am not sure of the
protocol here.

"Rick Rothstein" wrote:

Use the MIN and MAX functions...

=MAX(--"6/30/2008",A1)

=MIN(--"7/1/2009",A1)

--
Rick (MVP - Excel)


"lemonscented" wrote in message
...
I would like to calculate the fractions of various grants that can be spent
this fiscal year. Some of the projects start this year, some started
before
this year, other projects end this year, some projects continue after this
year, and others both start and end this year.

I have figured out how to calculate the total months in the grant using
DATEDIF. However, I don't know how to calculate the number of months for
this year.

To calculate the months for this fiscal year, I could also use DATEDIF.
The
first date would be either June 30, 2008 or the project start date
depending
on which is later. Likewise, the second date would be July 1, 2009 or the
project end date, whichever is earlier. How would the formula
automatically
select the correct dates?

Do I seem to be on the right track?



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default calculate fractions using dates

The two minus signs force Excel to convert the text representation of a date
into a real date. You could use the DATE function instead...

=MAX(DATE(2008,6,30),A1)

=MIN(DATE(2009,7,1),A1)

--
Rick (MVP - Excel)


"lemonscented" wrote in message
...
Thank you. That gets me started.

However, I don't know what the 2 hyphens (--)in the formula represent.
I tried to follow your recommendation and came up with this but it is not
correct-the answer is too large. Any suggestions?

=DATEDIF((MIN((D3),"6/30/2008")),(MAX((E3),"7/1/2009")),"m")/(DATEDIF(D3,E3,"m"))

My apologies if this question is too detailed. I am not sure of the
protocol here.

"Rick Rothstein" wrote:

Use the MIN and MAX functions...

=MAX(--"6/30/2008",A1)

=MIN(--"7/1/2009",A1)

--
Rick (MVP - Excel)


"lemonscented" wrote in message
...
I would like to calculate the fractions of various grants that can be
spent
this fiscal year. Some of the projects start this year, some started
before
this year, other projects end this year, some projects continue after
this
year, and others both start and end this year.

I have figured out how to calculate the total months in the grant using
DATEDIF. However, I don't know how to calculate the number of months
for
this year.

To calculate the months for this fiscal year, I could also use DATEDIF.
The
first date would be either June 30, 2008 or the project start date
depending
on which is later. Likewise, the second date would be July 1, 2009 or
the
project end date, whichever is earlier. How would the formula
automatically
select the correct dates?

Do I seem to be on the right track?




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default calculate fractions using dates

Rick,

I just realized the error in the formula I sent in the last posting - I
should have reversed the MIN and the MAX. Now it appears to be correct.

I would still be interested in knowing what the 2 hyphens mean.

Thank you.



"Rick Rothstein" wrote:

Use the MIN and MAX functions...

=MAX(--"6/30/2008",A1)

=MIN(--"7/1/2009",A1)

--
Rick (MVP - Excel)


"lemonscented" wrote in message
...
I would like to calculate the fractions of various grants that can be spent
this fiscal year. Some of the projects start this year, some started
before
this year, other projects end this year, some projects continue after this
year, and others both start and end this year.

I have figured out how to calculate the total months in the grant using
DATEDIF. However, I don't know how to calculate the number of months for
this year.

To calculate the months for this fiscal year, I could also use DATEDIF.
The
first date would be either June 30, 2008 or the project start date
depending
on which is later. Likewise, the second date would be July 1, 2009 or the
project end date, whichever is earlier. How would the formula
automatically
select the correct dates?

Do I seem to be on the right track?





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default calculate fractions using dates

Thank you!

"Rick Rothstein" wrote:

The two minus signs force Excel to convert the text representation of a date
into a real date. You could use the DATE function instead...

=MAX(DATE(2008,6,30),A1)

=MIN(DATE(2009,7,1),A1)

--
Rick (MVP - Excel)


"lemonscented" wrote in message
...
Thank you. That gets me started.

However, I don't know what the 2 hyphens (--)in the formula represent.
I tried to follow your recommendation and came up with this but it is not
correct-the answer is too large. Any suggestions?

=DATEDIF((MIN((D3),"6/30/2008")),(MAX((E3),"7/1/2009")),"m")/(DATEDIF(D3,E3,"m"))

My apologies if this question is too detailed. I am not sure of the
protocol here.

"Rick Rothstein" wrote:

Use the MIN and MAX functions...

=MAX(--"6/30/2008",A1)

=MIN(--"7/1/2009",A1)

--
Rick (MVP - Excel)


"lemonscented" wrote in message
...
I would like to calculate the fractions of various grants that can be
spent
this fiscal year. Some of the projects start this year, some started
before
this year, other projects end this year, some projects continue after
this
year, and others both start and end this year.

I have figured out how to calculate the total months in the grant using
DATEDIF. However, I don't know how to calculate the number of months
for
this year.

To calculate the months for this fiscal year, I could also use DATEDIF.
The
first date would be either June 30, 2008 or the project start date
depending
on which is later. Likewise, the second date would be July 1, 2009 or
the
project end date, whichever is earlier. How would the formula
automatically
select the correct dates?

Do I seem to be on the right track?





  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default calculate fractions using dates

You are welcome. Interestingly enough, when used within the MIN and MAX
functions, the double unary (double minus signs) is not required on the text
representations of the dates.

--
Rick (MVP - Excel)


"lemonscented" wrote in message
...
Thank you!

"Rick Rothstein" wrote:

The two minus signs force Excel to convert the text representation of a
date
into a real date. You could use the DATE function instead...

=MAX(DATE(2008,6,30),A1)

=MIN(DATE(2009,7,1),A1)

--
Rick (MVP - Excel)


"lemonscented" wrote in message
...
Thank you. That gets me started.

However, I don't know what the 2 hyphens (--)in the formula represent.
I tried to follow your recommendation and came up with this but it is
not
correct-the answer is too large. Any suggestions?

=DATEDIF((MIN((D3),"6/30/2008")),(MAX((E3),"7/1/2009")),"m")/(DATEDIF(D3,E3,"m"))

My apologies if this question is too detailed. I am not sure of the
protocol here.

"Rick Rothstein" wrote:

Use the MIN and MAX functions...

=MAX(--"6/30/2008",A1)

=MIN(--"7/1/2009",A1)

--
Rick (MVP - Excel)


"lemonscented" wrote in
message
...
I would like to calculate the fractions of various grants that can be
spent
this fiscal year. Some of the projects start this year, some
started
before
this year, other projects end this year, some projects continue
after
this
year, and others both start and end this year.

I have figured out how to calculate the total months in the grant
using
DATEDIF. However, I don't know how to calculate the number of
months
for
this year.

To calculate the months for this fiscal year, I could also use
DATEDIF.
The
first date would be either June 30, 2008 or the project start date
depending
on which is later. Likewise, the second date would be July 1, 2009
or
the
project end date, whichever is earlier. How would the formula
automatically
select the correct dates?

Do I seem to be on the right track?






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 to prevent Excel converting imported fractions into dates Phil A in the UK Excel Discussion (Misc queries) 6 March 28th 06 08:03 AM
Fractions show as dates ross Excel Discussion (Misc queries) 6 March 10th 06 03:32 PM
fractions turn into dates when pasting in excel 2003 Eddie Spaghetti Excel Discussion (Misc queries) 5 March 24th 05 03:07 PM
How do I keep excel 2002 from changing fractions to dates? pertimesco Excel Discussion (Misc queries) 6 March 1st 05 01:01 AM
How do I import fractions without data being converted to dates? rproeber Excel Discussion (Misc queries) 1 December 6th 04 12:53 AM


All times are GMT +1. The time now is 01:42 AM.

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"