I have an CV and would like to automatically update my age when opening. So, what formula should I insert in a MS Word field?
Something like:
{= {DATE} - {"01/01/1983"} }
I tried but could not find in Word fields the equivalent of the Excel way to substract a daytime from another one (let’s say 05/18/1983 from today 03/21/2013) which is easy in Excel since a daytime (01/01/1900 in Excel 2013) has been chosen as the beginning and every other day since is calculated according to this reference, the shown details only being a way of representing this result (full date, month in figures or its full name, or even the simple number of Excel), which can be toggled by right clicking on the cell and choosing the category cell format (since 01/01/1900 is 1, then 05/18/1983 is 30454 (...and also 00/01/1900 is 0!)).
To answer the initial question, I suggest this writing:
{= {DATE \@ "YYYY"} - my_year - 1*{=OR({={DATE \@ "MM"} < my_month};{=AND({={DATE \@ "MM"} = my_month};{={ DATE \@ "dd"} < my_day})})} \* MERGEFORMAT}
bearing in mind:
The MERGEFORMAT option is useful to keep the correct format.
Also, for those who are not used to working with Word fields:
That would do for 05/18/1983 (I changed 1st of January, which is 01/01 to 18th of avoid confusion):
{= {DATE \@ "YYYY"} - 1983 - 1*{=OR({={DATE \@ "MM"} < 05};{=AND({={DATE \@ "MM"} = 05};{={ DATE \@ "dd"} < 18})})} \* MERGEFORMAT}