View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Ron Rosenfeld[_2_] Ron Rosenfeld[_2_] is offline
external usenet poster
 
Posts: 1,045
Default Use excel to calculate an expiration date

On Mon, 5 Nov 2012 21:52:59 +0000, JRG wrote:


I'd like to create a formula in Excel that will calculate my products
expiration date. Obviously, I'll know the manufacturing date that can be
a calendar date in the form of : dd/mm/yy or julian date. The julian
date would be 2310 w/ 2 representing the last digit of the year(2012)
and 310 representing 11/5/12. My expiration date calculation will be
either adding 330 or 150 to the calendar date or julian date. Help!


=IF(A1DATE(INT(YEAR(TODAY())/10)*10,1,0),
A1,DATE(INT(YEAR(TODAY())/10)*10+
INT(A1/1000),1,MOD(A1,2000)))+330

Change the 330 to your days to expiration, or replace with a cell reference.
Note that the formula is "keyed" to the current decade. If you want to specify a decade that is not current, replace TODAY() with a date in the decade of interest.