Title: How to Use Excel TRIM Function to Remove Spaces and Clean Data
Headings: How to Use Excel TRIM Function to Remove Spaces and Clean Data
How to Use Excel TRIM Function to Remove Spaces and Clean Data
Excel TRIM Function – An Overview
When to use Excel TRIM Function
What it Returns
Syntax
Input Arguments
Excel TRIM Function – Examples
Example 1 – Remove Leading, Trailing, and Double Spaces
Example 2 – Remove Leading Spaces Only
How does this formula work?
Example 3 – Correctly Count Number of words when there are Additional spaces
Related Excel Functions:

Content: For example, if you want to count the total number of words in the phrase – “The quick brown fox jumps over the lazy dog”, you can simply count the spaces in between the words and add 1 to it. Here is the formula you can use to count words: =LEN (A1)-LEN (SUBSTITUTE (A1," ",""))+1
This formula substitutes all the spaces with blanks and then counts the number of spaces in the text and add 1 to it. However, when you have additional spaces in the text, this formula would not work. Here is the formula that you should use in such a case: =LEN (TRIM (A1))-LEN (SUBSTITUTE (A1," ",""))+1
The TRIM part of the formula in this takes care of the additional spaces. Related Excel Functions: Excel CONCATENATE Function. Excel LEFT Function. Excel LEN Function.