Excel Formulas to Remove the Leading and Trailing Spaces From Text!!
Tags: excelformula, excelformulas
Published: 2021-06-21 10:12:45

---
title: Excel Formulas to Remove the Leading and Trailing Spaces From Text!!
published: true
date: 2021-06-15 11:29:11 UTC
tags: ExcelFormula,Excelformulas
canonical_url: https://geekexcel.com/excel-formulas-to-remove-the-leading-and-trailing-spaces-from-text/
---

Have you ever tried to delete the extra spaces on your text string by using the formula in Excel? In this chapter, we will show the simple formulas to **remove the leading and trailing spaces from the text string in Excel**. Let’s dive into this article!! Get an official version of ** MS Excel**  from the following link: [https://www.microsoft.com/en-in/microsoft-365/excel](https://www.microsoft.com/en-in/microsoft-365/excel)

[![Remove the leading and trailing spaces from the text](https://geekexcel.com/wp-content/uploads/2021/06/Remove-the-leading-and-trailing-spaces-from-the-text.png)](https://geekexcel.com/excel-formulas-to-remove-the-leading-and-trailing-spaces-from-text/remove-the-leading-and-trailing-spaces-from-the-text/#main)<figcaption id="caption-attachment-46466">Remove the leading and trailing spaces from the text</figcaption>

## General Formula:

- You can use the below formula to remove the leading and trailing spaces from the text string in Excel.

**=[TRIM](https://geekexcel.com/use-trim-function-in-microsoft-excel-2013-simple-methods/)(text)**

## Syntax Explanations:

- **TRIM** – This function will help to remove the extra spaces from the text and there is no space at the start or end of the text string.  Read more on the **[TRIM function](https://geekexcel.com/use-trim-function-in-microsoft-excel-2013-simple-methods/)**.
- **Text** – It represents the input value.
- **Comma symbol (,)** – It is a separator that helps to separate a list of values.
- **Parenthesis ()** – The main purpose of this symbol is to group the elements.

## Example:

Refer to the below example image.

- Here we will enter the input text strings in **Column B**.
- Now we are going to delete all the extra spaces from the starting and end of the text string.

![Input Ranges](https://geekexcel.com/wp-content/uploads/2021/06/Input-Ranges-34.png)<figcaption id="caption-attachment-46465">Input Ranges</figcaption>

- Select any cell and type the above-given formula.

![Enter the formula](https://geekexcel.com/wp-content/uploads/2021/06/Enter-the-formula-45.png)<figcaption id="caption-attachment-46464">Enter the formula</figcaption>

- Finally, press the ** ENTER**  key, you can get the result as shown below.

![Result](https://geekexcel.com/wp-content/uploads/2021/06/Result-38.png)<figcaption id="caption-attachment-46463">Result</figcaption>

## Wind-Up:

From this guide, you can get some clarification on how to **remove the leading and trailing spaces from the text string in Excel**. Hope you like this article. Please feel free to state your **query** or **feedback** for the above article.

Thank you so much for visiting  **[Geek Excel](https://geekexcel.com/)!! **If you want to learn more helpful formulas, check out [**Excel Formulas**](https://geekexcel.com/excel-formula/) **!! **

### Read Ahead:

- **[Excel Formulas to Remove the Last Word ~ Easy Tutorial!!](https://geekexcel.com/excel-formulas-to-remove-the-last-word-easy-tutorial/)**
- **[Formulas for Counting Rows that Matches Two or More Criteria in Excel!!](https://geekexcel.com/formulas-for-counting-rows-that-matches-two-or-more-criteria-in-excel/)**
- **[Excel Formulas to Remove the First Character ~ A Complete Tutorial!!](https://geekexcel.com/excel-formulas-to-remove-the-first-character/)**
- **[Excel Formulas to Normalize the Text ~ A Complete Tutorial!!](https://geekexcel.com/excel-formulas-to-normalize-the-text-a-complete-tutorial/)**