View Single Post
  #4   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:
Hello,

I have five columns shown below, with sample values after the colon

(Col F) Today's Date: 04-28-06 {this will be using the =TODAY()
function}
(Col G) Contract Date Signed: 03-28-06
(Col H) Duration (Months): 12
(Col I) Expiration Date: 03-28-07*
(Col J) Days Remaining in Contract: 334*

* these are hypothetical, they are not correct

If the user puts 12 in column H, for the duration, the result will be
03-28-07.

But what if someone puts something other than 12, like 8, 6, 7, or 13?
I
need someway to be able to get Excel to tell me the EXACT day that the
contract will expire, AND how many days are left in the contract. BTW,
the
user will ALWAYS be entering whole numbers, not decimals, eg. 6.5
months.

Thanks in advance for your responses.

Phil.



Try this

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


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