Formula Calculation in "WORD"??

  Simsy 18:55 07 Apr 05
Locked

I know this can be easily done using Excel, but I wonder if it can be done in “Word”

I'm helping someone with a CV. Near the top I have a Date of Birth. Nearby I have the current age, in years.

What I have in mind is to automatically display the age in years, (calculated using the typed in DOB and the “TODAY”, or “NOW” function), when the file is opened. Hence opening it a year later would increase the age by a year.

I thought that it could possibly be achieved using a formula in a table, or using fields, but I can't fathom it, and suspect it can't be done.

Can anyone show me otherwise, using whatever method.

I don't want to go via another file, (such as an Excel file and mail merge), I want it all contained within the Document.

A macro on auto open I'd be interested in, though this isn't the preferred option.

Thanks in anticipation... even if it's only to put me out of my misery!

Regards,

Simsy

  Forum Editor 19:13 07 Apr 05

is this what you mean?

click here

  Simsy 19:35 07 Apr 05

that's EXACTLY what I'm after. Unfortunately, I'm not all that familiar with fields, and I'm not sure how to enter this.

There appears to be a reference to it being 2 fields.

Can anyone "walk" me through it? Do I need 2 fields?

Many thanks FE.

Regards,

Simsy

  Simsy 19:42 07 Apr 05

that this will do what I want. I don't even need to include the DOB from elswhere; I just bult it into the field.

I just can't get the syntax correct, and keep getting "Syntax error"

I'm doing the following;

Insert>Field>Equations and Formulas

Choosing "=(Formula)"

The box for the field code already has an equal sign in.

What next?

Thanks in anticipation.

Regards,

Simsy

  pauldonovan 20:57 07 Apr 05

You can either hard-code your birthdate or define a bookmark (highlight the birthdate in the doc and do Insert, Bookmark and give it a name - BirthDate in my example below:

Instead of doing Insert>Field

Go to where you want in the doc and do CTRL+F9

This should give you a curly brace field like:

{}

(but it'll be gray)

Start typing the formula below out, but every time you get to a new formula, I think it needs to be a proper word formula, not just a brace symbol so hit CTRL+F9 each time you get to a set of curly braces, then type in what's inbetween. The full formula with bookmark is this:


{ = INT({DATE \@ "yyyy" } +{ DATE \@ "M" } / 12 + { DATE \@ "d" } / 365.25 - { BirthDate \@ "yyyy" }- { BirthDate \@ "M" } / 12 - { BirthDate \@ "d" } / 365.25) }

It is a bit fiddly and there might be an easier way to turn that into a formula, but CTRL+f9 is the only way I could find about...

  Simsy 11:40 08 Apr 05

I seem to have got that working here at work, (Word XP),though I didn't at home last night, (Word 2000). Must have been a typing error, (many times!)

I'll try again when I get home tonight.

I won't tick it yet, in case I need further help with updating it on opening!

Many thanks,

Regards,

Simsy

  g0slp 14:52 08 Apr 05

I didn't realise that you could do such things in Word.

Great thread!

Regards,
Mark

This thread is now locked and can not be replied to.

What is Amazon Go and will it come to the UK? The store without checkouts or queues

1995-2015: How technology has changed the world in 20 years

Hands-on with the Star Wars fighting drones you can fly yourself

iPhone 9 and beyond: 32 amazing future smartphone developments - graphene, supercapacitor…