How to Use Trim Function remove spaces and clean data in Excel- Complete Guide

The TRIM Excel function is essential in removing all double spaces and cleaning the data. While typing datasets in Excel cells, one may have trailing and double spaces within the text. The process of identifying these spaces manually is tedious and time-consuming. If the user needs to clean the dataset, the TRIM function is the best tool to do so.

TRIM Function syntax

TRIM Function is an in-built function found in Excel that is used to clean the dataset. It has text as the arguments and return a text string with no double spaces. Here is the syntax of the TRIM function:

=TRIM (text)

Text: This is the argument (text string) that needs to be cleaned. In most cases, it takes the cell reference of the cell that contains the text string as an argument. For Example, =TRIM (A1)

Let us now discuss how one can use this function in Excel.

Methods

A] Using the Formula bar

Here are the steps to follow:

1. Open the Excel application.

2. Open the Workbook that contains your dataset or open a new worksheet.

3. Click on an empty cell that will hold the results, and then click on the Formula bar.

4. Type the Equal sign followed by the TRIM function. That is, =TRIM (

5. Select the cells with your argument (text string). For Example, =TRIM (A1)

6. Finally, hit the Enter key. That is all you need to do. The double spaces will be removed, and the clean data will be stored in the selected cell.

B] Using the Insert Function Tool

Steps to follow:

1. Open the Excel application.

2. Open the Workbook that contains your dataset or open a new worksheet.

3. Click on the Formulas tab on the screen, and then locate the Function Library section.

4. Click the Insert Function button to open the Insert Function dialogue box.

5. In the Search for a Function section, type TRIM, and press the Go button.

6. Select the TRIM option in the Select a Function section and then hit the Ok button.

7. In the Text section, click on the button on the right side, and select the cell that contains the string you want to clean.

8. Finally, click the OK button. That is all you need to do. The double spaces will be removed, and the clean data will be stored in the selected cell.

C] Using the Text Functions Tool

Steps to follow:

1. Open the Excel application.

2. Open the Workbook that contains your dataset or open a new worksheet.

3. Click on the Formulas tab on the screen, and then locate the Function Library section.

4. Click the Text drop-down button. From the menu, click the TRIM option.

5. In the Text section, click on the button on the right side and select the cell that contains the string you want to clean.

6. Finally, click the OK button. That is all you need to do. The double spaces will be removed, and the clean data will be stored in the selected cell.