Excel

TheSmallman.com

an XL ideas Lab

Dashboards VBA
  • Home
  • Dashboards
    • Tips & Tricks
    • Charts
    • Modelling
    • Infographics
    • VBA
  • Shop Dashboards
    • Power Pivot a User Guide
    • Excel Dashboard Course
    • Advanced Dashboard Course
    • Financial Modelling Course
    • Excel VBA Course
  • Blog
  • About
Menu

Excel Dashboards VBA

Street Address
City, State, Zip
Phone Number
an XL ideas Lab

Your Custom Text Here

Excel Dashboards VBA

  • Home
  • Dashboards
  • Excel Tips
    • Tips & Tricks
    • Charts
    • Modelling
    • Infographics
    • VBA
  • Shop Dashboards
  • PowerPivot
    • Power Pivot a User Guide
  • Courses
    • Excel Dashboard Course
    • Advanced Dashboard Course
    • Financial Modelling Course
    • Excel VBA Course
  • Blog
  • About

When TRIM Doesn't Work in Excel

May 8, 2019 Marcus Small
Not that kind of trim!!!Photo by Alex Mihai on Unsplash

Not that kind of trim!!!

Photo by Alex Mihai on Unsplash

The trim function in Excel is a formula to take out leading and training spaces. It usually works amazingly well, you simply point the formula at the cell with the issue and it will produce a clean piece of text without any leading or training spaces. This article will focuses on what to do when the TRIM formula does not work as expected. It looks at alternatives to solve the problem.

Recently I was trying to cleanse a data set of trailing spaces. I knew they were there so I went to the TRIM formula. I was shocked to find it did not work. So looking into the matter it seems others have had the same problem. If the text was in A2 my formula looked like this.

=TRIM(A2)

However the formula failed. So I used the following

=TRIM(CLEAN(A2))

The above formula worked like a charm. The Excel CLEAN function looks at a text string and returns text that has been made clean of line breaks and any other non-printable characters

So when trim doesn’t work consider using the it in conjunction with the CLEAN formula.

Tags trim, clean, Excel, won't work, doesn't work
← Excel Timesheet ExampleExcel Now Has 3D Pictures →

Featured Posts

Excel Dashboards: Tracking a Crisis

Excel Dashboards: Tracking a Crisis
April 14, 2020

Recent Posts

Populating an Excel Table from a Range of Cells with VBA

Populating an Excel Table from a Range of Cells with VBA June 12, 2025

Fuzzy Distribution with Randbetween

Fuzzy Distribution with Randbetween May 21, 2025

Add Minimum and Maximum for Chart in Cells

Add Minimum and Maximum for Chart in Cells March 12, 2025

Inflation Over Multiple Years in a Single Cell

Inflation Over Multiple Years in a Single Cell January 10, 2025

Hubspot Dashboard

Hubspot Dashboard October 3, 2024

Monthly Dashboard With Supporting Metrics

Monthly Dashboard With Supporting Metrics September 25, 2024

Excel Show Missing Sheet Tabs

Excel Show Missing Sheet Tabs July 29, 2024

Run Macro Overnight Automatically

Run Macro Overnight Automatically June 24, 2024

Split File into Parts and Save to Directory

Split File into Parts and Save to Directory April 20, 2024

Most Popular Author

Most Popular Author December 14, 2023

 

Follow US:

 
 

MarcusSmall@thesmallman.com

 

TheSmallman.com - Making your small systems hum...
© Copyright 2013-2024 theSmallman.com All Rights Reserved.