• Blog
  • The Developer
  • The Pyrotechnician

MS Excel: TRIM() Function

Microsoft’s Excel has a function called TRIM(), this function can be used to Prune leading and trailing spacing from a string

Understanding the way Excel uses TRIM()

This formula required 1 input; STRING.

The formula is as follows:

TRIM(STRING)

Using TRIM()

If I had the string ” Ian Blott, Web Developer, Sydney Australia ” in cell A1 and I wanted to remove the spaces at the start and end of the string

TRIM(A1)

This would return the value “Ian Blott, Web Developer, Sydney Australia”

This post is going somewhere, Dont worry about that. A week or so ago I posted about the SEARCH() function in MS Excel and I was searching for the locations of commas in a string.

As the english language works, there is almost allways a space after a comma in a string of text. When I was using the fancy part of the SEARCH() to do saerches within a search I was getting returning strings that would contain preceeding spaces ” Web Developer, Sydney Australia”. This is where the TRIM() function came in handly.

Getting Fancy

Ultimately the TRIM() function really only lends itself to one basic task. So getting fancy isn’t really something this guy can do.

Side note:

As with all my posts, quite often they are going somewhere and require 2,3 or even 4 different functions to perform the final task. Bellow are the related posts that tell an overall story

Other Blog Posts

  • Another Bot / Hack – This time, Casino Spam
  • Batch Scripts
  • Jest, Vite, Cypress, and Playwright are all tools used in web development, but they serve different primary purposes
  • Best practices for optimizing web performance.
  • How do you ensure cross-browser compatibility
  • Understanding the Concept of Virtual DOM: A Comprehensive Guide
  • What are React hooks, and why are they used?
  • What is event delegation? A Comprehensive Guide
  • Difference Between var, let, and const in JavaScript
  • What are CSS Pre-processors (SASS, LESS)?
  • Understanding the Difference Between Relative, Absolute, and Fixed Positioning in CSS
  • How Do You Optimize for SEO?
  • Comprehensive Guide to Jest Testing: Everything You Need to Know
  • What Are Semantic HTML Tags?
  • An Overview of Google Firebase Products
  • Title: Best Alternatives to Create-React-App for React Development
  • The Ultimate Guide to React: A Powerful JavaScript Library for Building Modern Web Applications
  • External Links Unveiled: The SEO Powerhouse Beyond Your Website’s Borders
  • Navigating Success: The Crucial Role of Internal Links in SEO Strategies
  • Unlocking Global Audiences: The SEO Guide to Multilingual Content Strategies
  • Cross-Server Content: Maximizing SEO Opportunities in a Distributed World
  • Avoiding SEO Pitfalls: Understanding Content Cannibalization and Its Impact
  • Harnessing Success: The Significance of Google Search Console in Your Digital Strategy
  • Decoding the Digital Landscape: The Crucial Role of Analytics in SEO Success
  • Redirects Unveiled: Navigating the Differences Between Hard and Soft Redirects
  • Painting the Web: A Palette of Possibilities with CSS Color Properties for SEO Excellence
  • Link Title Tags: Elevating SEO with Strategic Anchor Text
  • Reaching New Heights: A Comprehensive Guide to CSS Height Properties for SEO-Friendly Web Design
  • Picture Perfect: Mastering Image Optimization for SEO Success
  • Mastering CSS Width Properties: Crafting Responsive and SEO-Friendly Web Designs
  • Navigating SEO Gracefully: Understanding the Impact of Soft Redirects on Website Strategy
  • HTML Meta Tags: A Comprehensive Guide for SEO and Web Optimization
  • Navigating the SEO Landscape: Understanding Hard Redirects and Their Impact
  • Demystifying the CSS Media Queries: Crafting Responsive Designs for a Seamless User Experience
  • Decoding Robots.txt: A Guide to SEO’s Gatekeeper for Web Crawlers
  • Unveiling the Magic of CSS Transition Properties: Elevate Your Web Design with Smooth Animations
  • Mapping Success: The Crucial Role of Sitemaps in SEO Strategy
  • Mastering CSS Animation Properties: A Comprehensive Guide for Web Developers
  • Backlinks Unveiled: Navigating the Backbone of SEO for Elevated Web Presence
  • Mastering CSS Font-Family Properties: A Comprehensive Guide
  • The SEO Powerhouse: Unraveling the Impact of H1 Tags on Web Visibility
  • Unveiling the Aesthetics: A Deep Dive into CSS Background Properties
  • Unveiling the Power of Title Tags in SEO: Your Gateway to Online Visibility
  • Mastering CSS Display Properties: A Comprehensive Guide for Web Developers
  • Blogging for Success: The Vital Role of Blog Posts in SEO Strategies
  • Unleashing the Power of SEO: A Definitive Guide to Boost Your Online Presence
  • Unveiling the Power of CSS: A Comprehensive Guide for Beginners
  • What the hell is the blockchain?
  • What is a fork?
  • Bitcoin’s biggest problem
  • How to move Bitcoins between exchanges faster & cheaper
  • BitCar: An interesting way to own an exotic car
  • How To Pick WINNERS In Crypto! A Quick & Easy Explanation!
  • Building a Blockchain in Under 15 Minutes – Programmer explains
  • Sixty free lectures from Princeton on bitcoin & cryptocurrency.
  • The Blockchain Graveyard
  • But how does bitcoin actually work?
  • Ian Balina’s ICO Report
  • Australia’s biggest bank, the Commonwealth Bank: Blockchain has the potential to revolutionise the way we do business
  • Five things Everyone should do when playing with Cryptocurrencies
  • How to Easily Secure Your Favorite Cryptos with the Ledger Nano S
  • SAU NSW Sept 3 Texihkana
  • How not to run a Social Media Competition – NESCAFÉ Hungary
  • Another Last.fm account problem
  • Last.FM.. Hmmmm..
  • Site got Hacked
  • Last.FM about as trustworthy as Julia Gillard
  • Yahoo! Calendar
  • MS Excel: DATE() Function
  • MS Excel: TIME() Function
  • MS Excel: LOWER() & UPPER() Functions
  • MS Excel: MID() Function
  • How to create an event using .ICS Files for Apple’s iCal or Microsoft’s Outlook
  • MS Excel: SUBSTITUTE() Function
  • target=”_blank” replacement
  • MS Excel: TRIM() Function
  • MS Excel: LEFT() & RIGHT() Functions
  • MS Excel: SEARCH() Function
  • ID’s Cannot Start With a Number
  • FBML – Ajax – Facebook Authentication
  • Problems with Worpress, 2GlobalMart, PHP, SQL and IIS
  • JavaScript Twitter Feed – Returns
  • Portfolio Up and Running
  • Ajax – FBJS – Dynamic Form Submission Inside a Facebook App
  • HTML table, thead, tbody, tfooter Code Validation = Order specific
  • Footer Contacts – MouseOver Hovers
  • Footer Contacts – MouseOver Hovers
  • Twitter Feed – Simple JavaScript
  • Read More… Style Links and Limiting Character Length
  • What was a Journey of a Custom Word-Press Theme. Now Only Rants
  • Re Implementing Pages, Search Function & Links Section
  • JavaScript : Div Swapping for tabbed Content
  • Inefficiently access data for the Calendar
  • Dynamically Creating an astonishing iCal-like calendars with jQuery
  • Blott’s SEO ranking test
  • SEO ranking test #2
  • SEO ranking test #3

© 2026 Ian Blott