View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Luke M Luke M is offline
external usenet poster
 
Posts: 2,722
Default Advanced expiry date calculations

Let's say that the current expiration date is in A2, and renewal date is in A3:

New expiration date:
=IF(A3<=A2,DATE(YEAR(A2)+1,MONTH(A2),DAY(A2)),DATE (YEAR(A3)+1,MONTH(A3),DAY(A3)))

If you're wanting to know how many days from renewal date to new expiration
date:
=IF(A3<=A2,DATE(YEAR(A2)+1,MONTH(A2),DAY(A2)),DATE (YEAR(A3)+1,MONTH(A3),DAY(A3)))-A3

Note that you may need to format second formula as a number, as it may
default to a date format.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Torfinn Brokke" wrote:

Hello!

I asked some questions earlier today in another thread regarding the
calculation of expiry dates in Excel (the thread name is "Problem with "IF"
function"), but I have run into a new issue that is so complex (to me, at
least) that I chose to make a new thread about it.

I have successfully made a worksheet that will give a warning when an item
is about to expire. Here is an example:

John Doe has a license that will expire on August 31st, 2009. On August
12th, 2009 he renews his license. This renewal lasts for 12 months plus the
remainder of the last month, in this case until August 31st, 2010.

I have been able to calculate this in Excel with relative ease. But here is
the new challenge I'm facing:

John Doe has a license that will expire on September 30th, 2009. He can
renew this license at any time in the three months preceding expiry (i.e.
from July 1st, 2009 to September 30th, 2009) and have the license renewed
until September 30th, 2010. In other words the duration of the license will
be 12 months from September 30th, 2009 plus any number of days up to three
months before September 30th, 2009.

I hope this explanation is understandable. If not, I'll try to explain it
better. My question is: Can this calculation be done in Excel?

Thanks in advance for any help!