TRIMThe TRIM formula removes any leading and trailing whitespace from text in a cell. This can be useful when importing data or when dealing with data that includes extra spaces. The TRIM function is commonly used in data cleaning and formatting.
- How to use
- Examples of using
TRIMformula not working?
- Similar formulas to
TRIM formula with the syntax shown below, it has 1 required parameter:
- text (required):
The text or reference to a cell containing text that you want to trim. Text can be up to 50,000 characters.
ExamplesHere are a few example use cases that explain how to use the
TRIMformula in Google Sheets.
Removing extra spaces
Sometimes when importing data or copying and pasting from other sources, extra spaces can be added to text. TRIM can be used to quickly remove these extra spaces and clean up the data.
TRIM can be used to remove any extra spaces before or after names in a list, ensuring that the names are consistently formatted.
Cleaning up data
When working with large data sets, there can be inconsistencies in how data is formatted. TRIM can be used to clean up inconsistent formatting and make the data easier to work with.
TRIMnot working? Here are some common mistakes people make when using the
TRIMGoogle Sheets Formula:
Not using quotes around the text parameter
One common mistake when using the
TRIM formula is to forget to enclose the text parameter in quotes. If this is not done, the formula will return an error.
Using the formula on a range of cells
TRIM formula can only be used on a single text string at a time. If it is used on a range of cells, an error will be returned.
The following functions are similar to
TRIM or are often used with it in a formula:
CLEANformula is used to remove all non-printable characters from a given text string. This is useful when dealing with imported or copied data that contains hidden characters that can cause issues with further processing.
LOWERformula converts all letters in a specified text string to lowercase. It takes one required parameter, which is the text string to be converted. This formula is commonly used to standardize text data for easier analysis and comparison.
UPPERformula in Google Sheets converts all the letters in a given text string to uppercase. It takes one required argument, the
textto convert. This formula is commonly used to standardize text data or to make it easier to compare text values.
You can learn more about the
TRIM Google Sheets function on Google Support.