Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • Understanding Pivot Tables in Excel
  • Add Outline to Data in Excel
  • How To Sort One Column or Multiple Columns in Excel
  • How to create Checklist in Excel
  • How to create a Histogram in Excel

References

  • Extract data with helper column in Excel
  • Complete List of Excel Lookup and Reference Functions, References and Examples
  • How to retrieve first match between two ranges in Excel
  • Lookup entire row in Excel
  • Two-column Lookup in Excel

Data Validations

  • Excel Data validation unique values only
  • Excel Data validation must not contain
  • Excel Data validation whole percentage only
  • Excel Data validation require unique number
  • Excel Data validation allow uppercase only

How to Remove Leading Spaces in Excel

by

The TRIM function in Excel removes leading spaces, extra spaces and trailing spaces. Use the SUBSTITUTE function to remove all spaces or non-breaking spaces.

1. The TRIM function below removes 2 leading spaces, 3 extra spaces and 2 trailing spaces.

Note: the TRIM function does not remove single spaces between words.

2. To get the length of a string, use the LEN function.

Explanation: the LEN function counts 2 spaces, 2 characters, 4 spaces, 3 characters and 2 spaces.

3. You can use the SUBSTITUTE function to remove all spaces.

Note: the SUBSTITUTE function substitutes spaces (second argument) with empty strings (third argument).

Text imported from other applications may contain ASCII characters. The CLEAN function removes the first 32 non-printable ASCII characters (codes 0 through 31).

4. The CLEAN function below removes a non-printable character, CHAR(7).

5. Simply combine the CLEAN and the TRIM function to remove non-printable characters and spaces.

6. The CLEAN function removes line breaks. To enter a line break, press ALT + ENTER.

7. You can also use the SUBSTITUTE function to remove a line break, CHAR(10), and replace it with something else. For example, a comma and a space.

The CLEAN function doesn’t remove all ASCII characters. Simply use the SUBSTITUTE function to remove other ASCII characters.

8. First, find out the code number of the character.

9. Next, use the SUBSTITUTE and the CHAR function to return the text string without this character.

10. If your text contains non-breaking spaces, CHAR(160), the TRIM function doesn’t work.

11. You can use the SUBSTITUTE function to substitute non-breaking spaces, CHAR(160) with normal spaces, CHAR(32). Don’t forget to add a TRIM function to remove the extra spaces.

Post navigation

Previous Post:

COSH function: Description, Usage, Syntax, Examples and Explanation

Next Post:

Excel Data validation require unique number

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others

Logical Functions

  • Not Equal To ‘<>‘ operator in Excel
  • IF, AND, OR and NOT Functions Examples in Excel
  • TRUE function: Description, Usage, Syntax, Examples and Explanation
  • Extract multiple matches into separate rows in Excel
  • FALSE function: Description, Usage, Syntax, Examples and Explanation

Date Time

  • Find Last Day of the Month in Excel
  • Calculate number of hours between two times in Excel
  • How to calculate nth day of year in Excel
  • Calculate time difference in hours as decimal value in Excel
  • ISOWEEKNUM function: Description, Usage, Syntax, Examples and Explanation

Grouping

  • Running count group by n size in Excel
  • Group numbers with VLOOKUP in Excel
  • Group arbitrary text values in Excel
  • Group times into 3 hour buckets in Excel
  • Categorize text with keywords in Excel

General

  • Flash Fill in Excel
  • Basic text sort formula in Excel
  • Cell References: Relative, Absolute and Mixed Referencing Examples
  • Check if multiple cells have same value with case sensitive in Excel
  • Excel Default Templates
© 2026 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning