1. Calculation functions
  2. All Functions
  3. Text Functions
  4. TRIM

Use the TRIM function to replace multiple spaces with a single space.

The TRIM function is useful for removing extra spaces from data imported from an external system.

The text can be either a text string, or a line item formatted as text. In a line item formatted as text, Anaplan doesn't display leading, trailing, and extra spaces unless you double-click the line item or cell.



The TRIM function has the following arguments:

Argument Data type Description
text (required)


The text to trim.

To trim a text string, enclose it in double quotes, like this: TRIM("Other     Investments   ").

To trim text in a line item or list property that's formatted as text, reference the line item within the brackets. Leave out the double quotes.


This function has no constraints.


The following table shows some example formulas using the TRIM function.

You can enter text directly into your formula, or reference line items or list properties.

Formula Description Result
TRIM(" Capex  Auto   Approve Cap ")

In this example, a text string is specified inside double quotes. The text string contains leading, trailing, and extra spaces.

Capex Auto Approve Cap

TRIM(Office locations)

This example shows how you can include line items or list properties in your formula. In this example, Office locations is a text formatted line item, in the same module as the calculated line item. Office locations contains the following values:

San  Francisco

Los  Angeles

 New  York

San Francisco

Los Angeles

New York

TRIM(Health plan.Plan type)

In this example, Plan type is a line item in the Health plan module. The line item contains the value 'Dental  plan'.

Dental plan

Excel equivalent