I am trying to calculate the age of a piece of equipment and display as Year/Month. I am currently using the formula =DATEDIF(Manufacturer_Date,NOW(),"y") & "/" & DATEDIF(Manufacturer_Date,NOW(),"ym"). However, it does not calculate correctly. It displays months with a negative digit (see below). Can someone help me fix my formula?
Question
Question
Answer
Hi Vanessa
Couple of things I have found
You need to use TODAY() instead of NOW
Also, I have found I can only use the "Y","M", and "D" qualifiers (Year, Month and Day) as MD, YM and YD haven't worked for me in the past
Using this approach, I used DATEDIF to calculate the Years and total months (subtracting the Years (12 months) off of the total months to give you the actual Years and remaining Months as you were looking for
You formula would be
=DATEDIF(Manufacturer_Date,TODAY(),"Y")&"/"&SUB(DATEDIF(Manufacturer_Date,TODAY(),"M"),PRODUCT(DATEDIF(Manufacturer_Date,TODAY(),"Y"),12))
Replies
I had the same frustration with datedif, it does not seem to work. This earlier post had the solution.
You will need something more like (for the month part) =FLOOR(MOD((Manufacturer_Date)/365.25,1)*12,1)