• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Excel Tutorials by Y. Acosta

Excel Tutorials + Tips

  • Excel Tutorials
  • Etsy Store
  • Other Resources
  • About Me
    • About Me
    • Contact Me
    • FREE Printable List of Top Excel Keyboard Shortcuts
  • FREE pdf of Top Excel Shortcuts!

Remove Spaces in Excel: How to Use the TRIM Function (+ video tutorial)

❤ Support Free Excel Training by Sharing -

We may be compensated for your purchase of any of the products featured on this page – it helps us keep the lights on :)

There are a lot of steps to cleaning up a spreadsheet, especially if you’re working with raw data. A common need is to remove spaces at the end and the beginning of a cell in Excel.

This is super easy to do using Excel’s TRIM function.

How to Use the TRIM Function in Excel

WATCH: How to Use the TRIM Function in Excel (video tutorial)

What does the TRIM Function do in Excel?

TRIM, one of Excel’s Text functions, removes extra spaces from the beginning and end of a cell in Excel.

These extra spaces can be the result of formatting changes, mistakes in data entering, or other errors.

Why Use the TRIM Function

Having extra spaces in cells can affect how you can use the data in your spreadsheet.

Sorting your data, for example, won’t work correctly if your cells have extra spaces in the front.

Extra spaces at the end of cells can make it hard to correctly join text from different cells or use other features like Flash Fill.

Using TRIM to clean up these spaces will make your spreadsheet easier to use.

Ways to Use the TRIM Function in Excel

You can use TRIM to get rid of extra spaces one cell at a time or you can select a range of cells.

3 Steps to Use TRIM in an Excel Cell:

  1. Find a space in your spreadsheet where you can enter the TRIM function – next to your data is usually the easiest
  2. Type =TRIM(cell to TRIM)
    • In the parentheses, enter the cell address that you want to trim extra spaces from
  3. Press Enter
TRIM Function in Excel - Example
Example of TRIM Function in Excel

Apply the TRIM Function to Multiple Cells at the Same Time

You can also apply TRIM to a range of cells at once either by:

  • Dragging down your original TRIM function
  • Using copy and paste to apply it to other cells
  • Referencing the cell range in your TRIM function or
  • Assigning a Defined Name to your data range and referencing that name in your TRIM Function
Example of Applying TRIM to Range of Cells
Example of Applying TRIM to Range of Cells

NOTE: When you reference a range of cells inside your TRIM function, the results will be grouped (you’ll see a blue outline if you place your cursor in one of the results). This means that they cannot be edited or deleted. Doing so will cause an error for all the results in the group. Unless…

You replace the TRIM function results with only their values (i.e., removing the calculation).

To do this:

  1. Copy the TRIM results
  2. Right-click and select Paste Special
  3. Select Paste Values
Ungrouping Cells - Example
Ungrouping Cells – Example

You can also choose to keep your original data and the results of your TRIM function separately.

You decide!

What does the TRIM Function NOT Do?

The TRIM function only removes spaces from the beginning and end of a cell.

By, itself, it does not remove spaces between words or characters.

NEXT: How to remove extra spaces between words + line breaks from cells



Related Articles:

  • Clean up Extra Spaces in Excel (feat. image, thumbnail)
    3 Easy Ways to Clean up Extra Spaces in…
  • How to Add a Paragraph Line in Excel Cell - Tutorial
    Add and Remove Line Breaks in Excel (+…
  • How to Round Numbers in Excel - Tutorial
    How to Round in Excel - Tutorial

❤ Support Free Excel Training by Sharing -

blank

About Y. Acosta

Yil's (pronounced like "Jill") passion for Excel spreadsheets can be traced back to her days in marketing, where she spent significant time working on analytics. As a content creator, she now specializes in Excel spreadsheet tutorials. Make sure to visit the About page to learn more.

Reader Interactions

Comments

  1. blankBrett Prevett says

    at

    These statements are NOT TRUE:

    ‘The TRIM function only removes spaces from the beginning and end of a cell.’

    ‘By, itself, it does not remove spaces between words or characters.’

    If you have a double space between characters it will reduce it to a single space.

    Reply

Leave a Reply Cancel reply

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

Primary Sidebar

Follow us:

Latest Tutorial:

Featured image for How to Use Find & Replace to Remove Wildcard Characters in Excel article

Click Here for More Excel Tutorials!!!

Get Your FREE pdf of Top Excel Keyboard Shortcuts!

* indicates required

blank

Image-button for Invoice Template for Etsy

Copyright © 2025

  • Home
  • Excel Tutorials
  • Resources
  • About Me
  • Privacy Policy & Terms of Use
  • Disclaimer
  • Advertiser Disclosure
  • Contact Me
  • FREE Printable List of Top Excel Keyboard Shortcuts
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
SettingsAccept
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT