logo
search
Document Editing Problems

How to Calculate Age from a Birthdate Using Word Field Codes

Ayan MasoodAyan Masood Oct 10, 2026 870 views

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.

How to Calculate Age from a Birthdate Using Field Codes in Word
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.
Before you start

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.

Solution 1Recommended

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.

1
Bookmark the birthdate

Highlight the date of birth in your document, navigate to the 'Insert' tab, select 'Bookmark', type 'BirthDate' (without spaces), and click 'Add'.

2
Insert field code braces

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 {}.

3
Enter the formula

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.

4
Update the field

Right-click the field code and select 'Update Field', or simply press 'F9', to execute the formula and display the calculated age.

Manually Insert Field Codes and Bookmarks
Toggling Field Codes: You can press 'Alt+F9' at any time to toggle your view between the underlying field codes and the final calculated results.
Efficient Document Automation

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. 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. 2. Insert formula braces: Press 'Ctrl+F9' to generate functional field-code braces, then input your date calculation formula.
  3. 3. Calculate the result: Press 'F9' or right-click the field and select 'Update Field' to instantly display the calculated age.
Fully compatible with Microsoft Word (.docx) field codes and formulasEasily automate complex date calculations and document variablesFree, lightweight, and features an intuitive tabbed interface
microsoft office alternative - wps office

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.