> For the complete documentation index, see [llms.txt](https://help.docexport.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.docexport.com/template/advanced-options/microsoft-word-formulas.md).

# Microsoft Word Formulas

While DocExport allows you to output formula results and sum values directly from your monday.com board, **you can also use Microsoft Word's formula fields** to create additional calculations inside your template.

{% hint style="info" %}
Please note: Word formulas work only within the Word environment - they are not calculated on the monday.com board. These formulas will show the correct results only in the DocExport editor preview and the final PDF document.
{% endhint %}

Microsoft offers a comprehensive, official list of all Word field codes — including the formula field and its functions: [Microsoft Support: List of field codes in Word](https://support.microsoft.com/en-us/office/field-codes-formula-field-32d5c9de-3516-4ec3-80ed-d1fc2b5bc21d)

This reference covers everything from basic fields like `{ = (Formula) }` to advanced ones, along with their switches and formatting options.

## How to add Custom Calculations in Word Tables

1. Open your .docx template or create a new one.
2. Click into the table cell where you want the calculation to appear.
3. **Insert a Formula Field.**\
   Click on **'Insert'** in the top menu and select **'Fields'.** \
   You can also press  **Ctrl + F9** (Microsoft) or **\[⌘ + F9]** (Mac) to insert a field. \
   You’ll see curly brackets like this: `{ }`\
   &#x20;
4. Inside the brackets, add a Word formula like:\
   `{ ={{FieldA}}/{{FieldB}} }`\
   &#x20;Click on '**Table Layout'** and select '**Formulas**'.

   <figure><img src="/files/euPwgRlwG2PlUAG5pRlX" alt=""><figcaption></figcaption></figure>
5. **Format the result.** \
   Use the 'Number format' field or add `\#` to your formula to define the output format (e.g., percent, currency, decimal places): \
   `{ ={{FieldA}}/{{FieldB}} \# "0.00%" }`
6. **Update the field.**\
   Right-click the field and choose 'Update field' or press `F9` .
7. Save your document and re-upload the .docx template in DocExport.

<figure><img src="/files/Y3swa4f5L1sx6xu6FXp5" alt=""><figcaption><p>Example: This field should not display the sum, but show <strong>Total Admin / Total Billed Potential</strong> in percentage.</p></figcaption></figure>

## Helpful Tips for Using Mergefield Calculations

1. **Do not** type the curly brackets `{}` manually.\
   → Use the way described above to insert field brackets.
2. If you don´t see your field codes when you open your .docx file, you need to toggle them.\
   To **toggle field codes**, right-click the field and choose '**Toggle Field Codes'.**
3. After editing fields, **always** update them by selecting the field and pressing **F9.**<br>

## Other ways to use Microsoft Word Mergefields

Get inspired by the [list of field codes](https://support.microsoft.com/en-us/office/list-of-field-codes-in-word-1ad6d91a-55a7-4a8d-b535-cf7888659a51?utm_source=chatgpt.com) Microsoft provides. There are plenty more ways of using Mergefields within Microsoft Word templates.\
\
**Example:** Only display a field if it´s not empty. \
\
If {{CustomerNumber}} is **not empty**, the value is displayed. If it's empty, nothing is shown.\
`{ IF "{{CustomerNumber}}" <> "" "{{CustomerNumber}}" "" }`
