Excel templates keep their own formulas and totals when Salesforce data is merged, and the workbook recalculates when it opens. Every template format formats merged numbers, dates and times for the locale and time zone of the user who generates the document.
Formulas in Excel Templates
Write formulas in an Excel template the same way you would in any workbook. CloudFiles keeps them when it merges your Salesforce data.
Formulas in a table row. When a table added with Insert Table fills one row per record, a formula placed in the table's data row is copied to every generated row, with its cell references moved to that row. For example, a line total of =C5*D5 in the template becomes =C6*D6 on the next record's row, and so on for every record.
Formulas anywhere else in the workbook. Formulas outside the table work on the merged values too. A cell can add a merged discount to a merged subtotal, or calculate a due date from a merged invoice date.
Recalculation. Every generated workbook is set to recalculate fully when it is opened, so each formula shows its result for the merged data rather than the values saved in the template.
Totals
Locale and Time Zone Formatting
When a number, date, time or date-time field is merged without a format of its own, CloudFiles formats it for the locale of the user who generates the document, taken from their Salesforce user settings.
| Value | English (United States) | English (United Kingdom) | German (Germany) |
|---|---|---|---|
| Number 1234.56 | 1,234.56 | 1,234.56 | 1.234,56 |
| Date 15 March 2026 | 3/15/2026 | 15/03/2026 | 15.3.2026 |
Date-time values are shown in the user's own Salesforce time zone, with the zone named after the time, so a document generated by a user in London and one generated by a user in New York each show the time where that user is.
Two global variables carry these settings: $locale, set from {!$User.LocaleSidKey}, and $timeZone, set from {!$User.TimeZoneSidKey}. If either is empty, CloudFiles uses English (United States) and America/New_York.
To show a field in one fixed format for every user, set the format on the field in Insert Field; see Formatting Controls.