View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Morrigan
 
Posts: n/a
Default How to get the Excel to calculate the exact date from a given date


Phil Wrote:
Hi Morrigan,

Please see my responses (preceded with Phil:) below.

"Morrigan" wrote:


Morrigan Wrote:
Try this

I3 = DATE(YEAR(G3)+QUOTIENT(H3,12),MONTH(G3)+MOD(H3,12) ,DAY(G3))
J3 = VALUE(I3)-VALUE(F3)




Hmm....forgot to account for last day of the month.

What do you want to show if you sign the contract on Jan 31 and
duration is 1 month.


Phil: I won't have any instances that will have a 1 month contract.
The
lowest contracts that we will have is 3 months, if that is relevant to
your
question.

Is expiration date going to be Feb 30 or March 1
or something else?


Phil: I'm not sure I'm following you here. Can you please expand on
this,
if needed, based on my response above?

--
Morrigan

------------------------------------------------------------------------
Morrigan's Profile:

http://www.excelforum.com/member.php...fo&userid=7094
View this thread:

http://www.excelforum.com/showthread...hreadid=537229




I used 1 month just as an example to demonstrate what should happen
with some months have 31 days and some have 30 days or less. Since Feb
does not have 31st, if you sign a contract on Jan 31st and the duration
ends in the month with less than 31 days, what do you want the
expiration date to be? Should it be Feb 28 or March 1 or neither?

In my second post, I modified the equation so that it will account for
the above situation assuming the correct output would be Feb 28.


--
Morrigan
------------------------------------------------------------------------
Morrigan's Profile: http://www.excelforum.com/member.php...fo&userid=7094
View this thread: http://www.excelforum.com/showthread...hreadid=537229