I have a MS document that i use as a chain-of custody and analytical results report for air samples. I would like for the document to calculate total minutes from my start and stop time data entry fields as well as calculate total volume from the total minutes and liters per minute field boxes. If I can get that far, I would also like to have the document automatically calculate my final sample results using the following equation:

total fibers/ total fields

total volume x 7.85

I have separate text fields I use to enter the total fibers count as well as another text field I use for total fields.

  • 2
    You can do basic math inside a table. – fixer1234 May 14 '16 at 18:41
  • Please note that Super User is not a script writing service. If you tell us what you have tried so far (including any scripts you are using) and where you are stuck then we can try to help with specific problems. You should also read How do I ask a good question?. – DavidPostill May 14 '16 at 19:21
  • There is an answered example of a similar kind of problem at stackoverflow.com/questions/21335920/… – user181946 May 28 '16 at 15:53

You can do formulas in Word.

CTRL+F9 will let you add a FIELD in Word in which you can type several expressions, ant ALT+F9 will show/hide all the fields in the document. You can add FIELDS inside fields themselves to build complex expressions. Fields are shown with curly brackets and each curly bracket group should be added using CTRL+F9 (or a copy/paste from another expression).

Here are some examples to get an idea:

{SET a{=INT((14-month-1)/12}}
{QUOTE{=dd*10^6+mm^10^4 \# "00'-'00'-'0000'} \@ "d MMMM yyyy"}}
{=TotalVolume*7.85 \*cardtext}

The first sets a value, the second displays a computed date, the third should correspond to an expression required in the question with "TotalVolume" already defined as a Bookmark for instance. (Remember to not type the curly braces, get them using CTRL+F9).

Any of the "variables" should be either defined using a "SET" or as a Bookmark in your document.

This feature is not used a lot, so it's not easy to find a good tutorial. A good start to learn how to use this is Microsoft's documentation. You can start with Field code - SET - it has examples futher down in its explication. You can go from there and see for instance that you can have word request data by using the FIELD CODE "FILLIN". While reading that extract, I've learned that CTRL+F9 is available through the menus from the Insert toolbar / Quick Parts / Field which may also help you to start discovering this functionnality.

| improve this answer | |

From Office support:

  • On the Insert tab, in the Symbols group, click the arrow next to Equation.

  • equation command in the symbols group

  • Click the equation that you want, or click Insert New Equation to type an equation.

If you are looking to solve equations, and don't really need to solve them natively in Word, you could use a web calculator like web 2.0 calc, but otherwise you will most probably need an add-on. If you use Windows, this plugin might work. I haven't tried it, since I am using a mac, but it should be straightforward, judging from the website.

| improve this answer | |
  • 2
    The question is looking for a way to calculate the equation results rather than just entering a well-formatted equation. – fixer1234 May 14 '16 at 18:37
  • Added another solution @fixer1234 – William Brochmann May 14 '16 at 18:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.