Excel Tutorial
Excel tutorials, quizzes & AI guides — all levels
RSS
  • Online Excel Exercises
  • Training
  • Excel Tests
  • Sitemap
  • Premium Quizzes
  • Shop
  • My account

The TRIM function of Excel

Text functions
Reading time: 2 minutes
Views: 4,981

The TRIM function is very useful for cleaning all the spaces before and after a string in Excel. It is one of the Top 10 Excel functions you must know.

This function only requires one argument: the text you want to clean 😉

=TRIM(text)

When importing data into Excel, using this function is highly recommended to clean extra spaces in your cells. This is essential for ensuring data accuracy, such as when sorting the data. Extra spaces at the beginning or end of strings can disrupt sorting, leading to incorrect results.

Sort with Spaces returns wrong result

Remove the spaces with the TRIM function

To clean up your data, use the formula: =TRIM(A2)

TRIM to remove the spaces in your cells

This function only removes spaces at the beginning or end of the text, not within it.

Transform the formulas into values

Once you use the TRIM function, it’s important to convert these formulas into values. Leaving them as formulas means that the original cells still contain the unwanted spaces. To keep only the cleaned results, use Paste Special and select “Values.”

Alternatively, use this trick with your mouse:

  1. Select your range of cells
  2. Right-click and drag the range to a new location
  3. Drag it back to the original location
  4. Release the right mouse button
  5. Select “Copy here as Values only”
Trick to Copy Paste value with the mouse

Related articles

  • Beginner Excel Test
  • Excel Advanced Test
  • Functions LEFT – RIGHT – MID
  • The LEN function in Excel
  • Roman numerals with Excel
  • Capitalize the first letter in Excel (Camel Case)
  • Tips and Tricks to Paste Data in Values
  • Examples of Paste Special (All Options)

Frédéric LE GUEN

copy paste special value, Top 10, TRIM

Leave a Reply Cancel reply

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

Most Viewed Posts

  • Displaying Negative Numbers in Parentheses in Excel (310,065)
  • Top 10 Excel Functions You Must Know (232,001)
  • How to make automatic calendar in Excel (212,775)
  • Dash for a zero in Excel automatically (190,813)
  • Converting a Date from YYYYMMDD to DD/MM/YYYY in Excel (171,034)
image excel exercises
Excel Exercises
image excel quizzes
Excel Quizzes

The TRIM function of Excel

Reading time: 2 minutes
Views: 4,981

The TRIM function is very useful for cleaning all the spaces before and after a string in Excel. It is one of the Top 10 Excel functions you must know.

This function only requires one argument: the text you want to clean 😉

=TRIM(text)

When importing data into Excel, using this function is highly recommended to clean extra spaces in your cells. This is essential for ensuring data accuracy, such as when sorting the data. Extra spaces at the beginning or end of strings can disrupt sorting, leading to incorrect results.

Sort with Spaces returns wrong result

Remove the spaces with the TRIM function

To clean up your data, use the formula: =TRIM(A2)

TRIM to remove the spaces in your cells

This function only removes spaces at the beginning or end of the text, not within it.

Transform the formulas into values

Once you use the TRIM function, it’s important to convert these formulas into values. Leaving them as formulas means that the original cells still contain the unwanted spaces. To keep only the cleaned results, use Paste Special and select “Values.”

Alternatively, use this trick with your mouse:

  1. Select your range of cells
  2. Right-click and drag the range to a new location
  3. Drag it back to the original location
  4. Release the right mouse button
  5. Select “Copy here as Values only”
Trick to Copy Paste value with the mouse

Related articles

  • Beginner Excel Test
  • Excel Advanced Test
  • Functions LEFT – RIGHT – MID
  • The LEN function in Excel
  • Roman numerals with Excel
  • Capitalize the first letter in Excel (Camel Case)
  • Tips and Tricks to Paste Data in Values
  • Examples of Paste Special (All Options)
Tags: copy paste special valueTop 10TRIM

Frédéric LE GUEN

Leave a Reply Cancel reply

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

Contact us
About me 
Privacy Policy

© 2022 – 2026 – excel-tutorial.com. All Rights Reserved.
Excel Tutorial is managed by majordome du net

Contact us
About me 
Privacy Policy

© 2022 – 2026 – excel-tutorial.com. All Rights Reserved.
Excel Tutorial is managed by majordome du net