How to Calculate Age from a Birthdate Using Word Field Codes
Question details
The user needs to insert specific field codes in a Word document to automatically calculate and display a person's age based on a bookmarked birthdate.

- Product
- Word
- Device & OS
- not provided
- Scenario
- Creating dynamic forms or documents where age needs to be continually updated and calculated from a specified date of birth.
- Observed behavior
- A dynamic field displays the correctly calculated age and updates automatically whenever the underlying birthdate data is modified.
Ensure you have the birthdate typed into your document before starting. Remember that field code braces {} must be inserted using keyboard shortcuts, as manually typing them on your keyboard will not work.
Manually Insert Field Codes and Bookmarks
Use keyboard shortcuts to create a bookmark for the birthdate and insert functional field code braces for the age calculation formula.
Word relies on specific bookmarks and functional field braces to perform mathematical calculations. A standard typed bracket will just be treated as regular text.
Highlight the date of birth in your document, navigate to the 'Insert' tab, select 'Bookmark', type 'BirthDate' (without spaces), and click 'Add'.
Click where you want the age to appear. Press 'Ctrl+F9' (or 'Ctrl+Fn+F9' on some laptops) to insert the functional field-code braces {}.
Inside the braces, type your specific age calculation formula referencing the 'BirthDate' bookmark, making sure to add any required closing braces at the end of the formula.
Right-click the field code and select 'Update Field', or simply press 'F9', to execute the formula and display the calculated age.

Use Pre-built Date Calculation Templates
Copy and paste complex, ready-made field codes from reliable date calculation tutorials to save time and avoid formula syntax errors.
Automate Date Calculations with WPS Office
WPS Writer provides comprehensive support for complex field codes and bookmarks, allowing you to seamlessly calculate ages, dates, and dynamic data just like you would in Microsoft Word.
- 1. Bookmark the date: Open your document in WPS Writer, highlight the birthdate, go to the 'Insert' tab, click 'Bookmark', and name it 'BirthDate'.
- 2. Insert formula braces: Press 'Ctrl+F9' to generate functional field-code braces, then input your date calculation formula.
- 3. Calculate the result: Press 'F9' or right-click the field and select 'Update Field' to instantly display the calculated age.

Frequently Asked Questions
Why aren't my field code braces working when I type them manually?
Field code braces cannot be typed normally using the curly brace keys on your keyboard. You must press 'Ctrl+F9' (or 'Ctrl+Fn+F9' on some laptops) to insert the special braces that Word recognizes as a functional field.
How do I edit the calculation formula after it shows the result?
You can toggle the display between the calculated result and the underlying formula by pressing 'Alt+F9'. This makes the field codes visible so you can edit the text inside them.
Will the calculated age update automatically if I change the birthdate?
It will not update instantly on its own. After modifying the date in the 'BirthDate' bookmark, you must select the calculated age field, right-click, and choose 'Update Field' (or press F9) to refresh the output.
Can I calculate the exact age including months and days?
Yes, but this requires a much longer and more complex field code construction. It is highly recommended to download a pre-built template, such as Graham Mayor's DateCalc document, and copy the comprehensive years/months/days formula from there.




