Dec 20 2021 03:24 PM
Excel Microsoft 365/Windows 10/Laptop
I am having trouble figuring out how to write the formula using a nested EDATE function. I am creating a spreadsheet of food expirations and some of the products use Julian dates and some use best buy dates. For the Julian dated ones I am converting the Julian Date to a calendar date using the below formula:
=IF(C5="","",(DATE(IF(0+(LEFT(C5,2))<30,2000,1900)+LEFT(C5,2),1,MID(C5,3,3))))
Is it possible to nest an EDATE function within the above formula to add the shelf life to the result of the Julian date being converted?
Currently I have the following EDATE formula in a separate column but I am trying to avoid that if possible and combine the 2 formulas:
=IF(D5="","",(EDATE(D5,B5)))
The expiration date column will have data imputed for the best buy dated products and excel does not allow the ability to lock the formula only in a cell.
Any help is greatly appreciated. I haven't been able to figure out how to structure the combined formulas. I am new to using formulas that venture off the path of easy into more complex.
Thanks
Dec 20 2021 04:06 PM - edited Dec 20 2021 04:09 PM
Solution
=IF(C5="", "",
EDATE(DATE(IF(--LEFT(C5,2)<30, 2000, 1900)+LEFT(C5,2), 1, RIGHT(C5,3)), B5))
If C5 might contain only 4 digits for dates less than 2010, replace C5 with TEXT(C5,"00000") .
I don't know how you calculated E7.
Dec 20 2021 05:07 PM
Dec 20 2021 04:06 PM - edited Dec 20 2021 04:09 PM
Solution
=IF(C5="", "",
EDATE(DATE(IF(--LEFT(C5,2)<30, 2000, 1900)+LEFT(C5,2), 1, RIGHT(C5,3)), B5))
If C5 might contain only 4 digits for dates less than 2010, replace C5 with TEXT(C5,"00000") .
I don't know how you calculated E7.