Anyone good at it? Essentially my boss wants me to write a macro that calculates the years and months between a given date and today's date. i know how to write the formula in excel, but he wants it to be functional in a table in word. edit: actually i'm not even sure how to write that in excel, i only know how to do it to calculate months, not years and months example: =(YEAR(NOW())-YEAR(E3))*12+MONTH(NOW())-MONTH(E3) Any help would be appreciated.
I personally do not know how, but I was able to find some links that may help you. How to Create a Word 2007 Macro Record or run a macro (Microsoft website) How to Calculate the Difference Between Dates in Excel using DATEDIF() Macro to Calculate Date Difference
Modified formula from Microsoft. =YEAR(TODAY())-YEAR(E3)-IF(OR(MONTH(TODAY()) < MONTH(E3),AND(MONTH(TODAY())=MONTH(E3), DAY(TODAY())< DAY(E3))),1,0)&" years, "&MONTH(TODAY())-MONTH(E3)+IF(AND(MONTH(TODAY()) <=MONTH(E3),DAY(TODAY())< DAY(E3)),11,IF(AND(MONTH(TODAY()) < MONTH(E3),DAY(TODAY()) >= DAY(E3)),12,IF(AND(MONTH(TODAY())> MONTH(E3),DAY(TODAY()) < DAY(E3)),-1)))&" months, "&TODAY()-DATE(YEAR(TODAY()),MONTH(TODAY())-IF(DAY(TODAY()) < DAY(E3),1,0),DAY(E3))&" days" I don't get what you would want a macro to process/do or how this would be applicable to Word.