Is it possible to calculate a person’s age from their date of birth in Microsoft Word 2003?
I know this can be done in Access and Excel, but can it be done in Word?
Tom
![]() |
Patch reliability is unclear, but widespread attacks make patching prudent. Go ahead and patch, but watch out for potential problems. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » calculate age from date of birth in Word 2003
Is it possible to calculate a person’s age from their date of birth in Microsoft Word 2003?
I know this can be done in Access and Excel, but can it be done in Word?
Tom
Hi Tom,
To see how to do this and just about everything else you might want to do with dates in Word using field coding (not macros), check out my Word Date Calculation Tutorial in [post=”249902″]Post 249902[/post]. In particular, look at the item titled ‘Interactively Calculate A Person’s Age’. Do read the document’s introductory material.
It’s also possible to do the same sort of thing with a macro.
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Hi Tom,
To see how to do this and just about everything else you might want to do with dates in Word using field coding (not macros), check out my Word Date Calculation Tutorial in [post=”249902″]Post 249902[/post]. In particular, look at the item titled ‘Interactively Calculate A Person’s Age’. Do read the document’s introductory material.
It’s also possible to do the same sort of thing with a macro.
Macropod
Thanks! I downloaded the file and will have a look at it.
I’m not wild about using a Macro, because the of the potential intrusion by viruses.
Tom
An example of what I want to do is calculate the age, using the date of birth July 29, 1937, or 7/29/1937
So I plugged in the following
{QUOTE
{ASK StartDate “What is the starting date, in dd/mm/yyyy format, please?” d 13/05/2009″}}{ASK Delay “What is the number of days +/- offset?”}
SET a{=INT((14-{ StartDate @M})/12)}}
{SET b{={StartDate @} yyyy}+4800-a}} … plus the rest of whatever is in the code
All I end up getting is the following:
If the starting date is Monday, 1 January 2001 and the offset is 0 day, then the new date is Tuesday, 6 January 2009.
How do I fix this?
Thanks.
Tom
An example of what I want to do is calculate the age, using the date of birth July 29, 1937, or 7/29/1937
All I end up getting is the following:
If the starting date is Monday, 1 January 2001 and the offset is 0 day, then the new date is Tuesday, 6 January 2009
How do I fix this?Thanks.
Tom
Hi Tom,
That’s not the field code I pointed you to! It looks like the code from ‘Interactively Calculate A Past Or Future Date’, to which you’ve added a default starting date of 13/05/2009. It’s hardly surprising you didn’t get the result you’re after.
All you need to do is to copy the *correct* field code into your document, select it and press F9. For the ‘July 29, 1937’ input, I get:
If your Date of Birth was 29 July 1937, then your age is 71 Years, 9 Months and 15 Days.
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Thanks for the feedback.
I apologize. Very sorry…I got on the wrong code.
When I highlight the code and press F9 I get the Input Box, “What is the birth date?”
I enter the birth date and press OK…then I’m back in the code.
Next, I press F9, I get If your Date of Birth was 29 July 1937, then your age is 71 Years, 9 Months and 15 Days.
I guess that’s the way it’s supposed to work.
I’m getting closer. What I need to do now is work with the code, so that I end up getting only the age part, i.e. 71 Years, 9 Months and 15 Days
This works nicely for children. Probably for adults I will need to get only the years, i.e. 71 years
Tom
As macropod explains in his document, the field codes only work correctly for dates between January 1, 1901 and December 31, 4095. To make them work with dates outside this range, they need to be modified considerably. See the section “Working With Dates Before 1 Jan 1901 Or After 31 Dec 4095” in macropod’s document.
As macropod explains in his document, the field codes only work correctly for dates between January 1, 1901 and December 31, 4095. To make them work with dates outside this range, they need to be modified considerably. See the section “Working With Dates Before 1 Jan 1901 Or After 31 Dec 4095” in macropod’s document.
Missed that piece. It’s not worth turning modification hoops to do it, as the need will be rare indeed.
Tom
Indeed! Just how many people do you need to work out the age for who were born before 1/1/1901?
Paul
Many thanks for referring this valuable resource to me!
The situation in question has a couple of people over 100 years of age, but nobody beyond 107. I’d also be surprised if I were to be around long enough to hit the year 4095…unless I was related to Mel Brooks’ 10,000 year old man!
Cheers!
Tom
Paul
Many thanks for referring this valuable resource to me!The situation in question has a couple of people over 100 years of age, but nobody beyond 107. I’d also be surprised if I were to be around long enough to hit the year 4095…unless I was related to Mel Brooks’ 10,000 year old man!
Cheers!
Tom
Hi Tom,
I’m glad to hear your appointment calendar isn’t full till 4095 …
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Here’s my puzzle, with a bit of a snag.
Access is on System One. A complete database that includes a number of persons with names, addresses, date of birth etc.
Access is not on System Two and, for complicated reasons, it’s not wanted on that system. However, there is one report from the Access file that System Two wants to use.
It is largely more like a pre-printed form on which Access grabs the person’s first name, last name and birth date, calculates the age of the person, fills those 4 things in on the report and prints it.
The report could be pre-printed for use in Word.
System two wants to take the pre-printed form, have mail merge fields for the four fields (the one field code calculating the age, which is why I made this post initially), grab the data for the person desired from the Access file and print.
Is there a way to connect to Access from Word, without having Access on System Two?
Tom
1) On system 2:
Start Word.
Select Tools | Options…
Activate the General tab.
Make sure that the check box “Confirm conversion at Open” is ticked.
Click OK.
Open the merge document.
Activate the Mail Merge task pane and go to step 3.
If your document is already connected to the database, click Select another list, otherwise click Browse…
When you select the Access database, Word will prompt you to choose a method to connect to the database. Do *not* choose the DDE method – this requires Access to be present. The other methods (OLE DB and ODBC) should work OK even if Access has not been installed.
2) Why not calculate the age in Access instead of in Word?
1) On system 2:
Start Word.
Select Tools | Options…
Activate the General tab.
Make sure that the check box “Confirm conversion at Open” is ticked.
Click OK.
Open the merge document.
Activate the Mail Merge task pane and go to step 3.
If your document is already connected to the database, click Select another list, otherwise click Browse…
When you select the Access database, Word will prompt you to choose a method to connect to the database. Do *not* choose the DDE method – this requires Access to be present. The other methods (OLE DB and ODBC) should work OK even if Access has not been installed.2) Why not calculate the age in Access instead of in Word?
Hans
I agree with you entirely. By far the best solution is to get Access on System 2. (it’s complicated)
Tom
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.