> For the complete documentation index, see [llms.txt](https://university.gonexa.fr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://university.gonexa.fr/doc/en/advanced-features/pdf-excel-powerpoint-templates/create-excel-template.md).

# Create an Excel document template

Create a document template in XLSX input format

{% embed url="<https://www.youtube.com/watch?v=xCt5B-Quzlw>" %}

This training is broken down into **4 steps**:

* Creating a table in Excel
* Making calculations (average, maximum, sum…)
* Creating a formula
* Inserting a pivot table

{% hint style="info" %}
**Prerequisites**

* Know how to build a Word template
* Have created a document template with a child object
  {% endhint %}

## Create a table in Excel

From the document template, add tags on the main objects as you wish using the assistant panel.

To add tags on a child object, you must first have configured a child object in the document template.

{% hint style="warning" %}
**Tip**

Define the print area of your Excel sheet so that all elements appear on a PDF page at generation. View the final version by switching your Excel file to Page Layout view.
{% endhint %}

### Add a table

* Insert a header row in your document with the column titles
* In a second row, insert the tags on the child object using the assistant
* Select the table, then from the Insert tab, click Table
* Check the "My table has headers" box if you have already set them up, and click OK
* Once the table is created, go to the Table tab.
* In the Table Name box, name it with the label of the child object configured in Salesforce. (E.g. QuoteLineItem)

Save, upload your document to Salesforce and test it.

## Make calculations (average, maximum, sum…)

Make calculations such as the average, the maximum and the sum related to your table.

### Enable the Total Row

* Select the table you already created
* From the Table tab, check the "Total Row" box
* An additional row appears
* Select the new cell and click the arrow to choose the type of calculation to perform: average, maximum, minimum, sum…

Save, upload your document to Salesforce and test it.

## Create a formula

Avoid creating a formula field in Salesforce and add the logic directly in your Excel document.

### Enable the total row

* Insert a column in your table and give it a name
* In the row of the new column, insert your Excel formula starting with "="
* Select the cell(s) involved in the calculation and build your formula in the following form: `= C17 * 0,20`

{% hint style="warning" %}
**Tip**

Apply the expected number formats (general, currency, fraction, time, date…) so that the correct format appears at generation.
{% endhint %}

Save, upload your document to Salesforce and test it.

## Insert a pivot table

Display a chart and cross-referenced information dynamically in your document, on a separate sheet.

### Create a pivot table

* Select your table
* From the Insert tab, click PivotTable
* In the "Create PivotTable" pop-up, check "New Worksheet" to display the report on a separate worksheet, and click OK.
* On the new sheet where your pivot table will appear, check the boxes of the table fields you want to show in your pivot table
* Move the fields into the target areas (filters, columns, rows and values) by dragging and dropping them.
* Click the i next to the item to choose how it is summarized: sum, average, maximum…

Save, upload your document to Salesforce and test it.

{% hint style="danger" %}
**Warning**

You cannot add Gonexa Doc tags on the same sheet as your pivot table.
{% endhint %}

### Add a chart

* With your pivot table selected, select the chart you want to display.
* Place it on the page where you want it.

Save, upload your document to Salesforce and test it.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://university.gonexa.fr/doc/en/advanced-features/pdf-excel-powerpoint-templates/create-excel-template.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
