ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Use excel to calculate an expiration date (https://www.excelbanter.com/excel-discussion-misc-queries/447573-use-excel-calculate-expiration-date.html)

JRG

Use excel to calculate an expiration date
 
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!

Ron Rosenfeld[_2_]

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.

JRG

Quote:

Originally Posted by Ron Rosenfeld[_2_] (Post 1607128)
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.

T/Y for your help Ron. I'll give it a whirl.


All times are GMT +1. The time now is 02:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com