{"id":6490,"date":"2021-01-20T16:42:17","date_gmt":"2021-01-20T15:42:17","guid":{"rendered":"https:\/\/www.myexcelonline.com\/?p=6490"},"modified":"2024-05-19T11:08:11","modified_gmt":"2024-05-19T09:08:11","slug":"how-to-remove-leading-and-trailing-spaces-in-excel","status":"publish","type":"post","link":"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/how-to-remove-leading-and-trailing-spaces-in-excel\/","title":{"rendered":"How to Remove Leading and Trailing Spaces in Excel"},"content":{"rendered":"<p>In <a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/excel-interview-questions\/\" target=\"_blank\" rel=\"noopener\">Excel<\/a>, you may sometimes<strong> find unwanted and extra spaces<\/strong> in your data. It might take a considerable amount of time to <strong>clean this data and make it perfect for further analysis<\/strong>.<\/p>\n<h4>So, it is extremely important to Excel remove trailing spaces!<\/h4>\n<p><em><strong>Leading spaces<\/strong><\/em> (at the start of the text), <em><strong>Trailing spaces<\/strong><\/em> (at the end of the text) and <em><strong>Non-Breaking spaces<\/strong> <\/em>(prevents line breaks from occurring at a particular point) usually get in the way when we want to perform operations in Excel.<\/p>\n<p>Let&#8217;s look at each one of these methods on how to remove leading spaces in Excel, trailing spaces as well as non-breaking spaces!<\/p>\n<h3><span style=\"color: #339966\"><a id=\"trim-function-to-remove-extra-spaces\"><\/a>TRIM Function to Remove Extra Spaces<\/span><\/h3>\n<p><em><strong>What does it do?<\/strong><\/em><\/p>\n<p>Removes unneeded spaces in your text, except single spaces in between words<\/p>\n<p><em><strong>Formula breakdown:<\/strong><\/em><\/p>\n<p>=TRIM(text)<\/p>\n<p><em><strong>What it means:<\/strong><\/em><\/p>\n<p>=TRIM(text that you want extra spaces to be removed)<\/p>\n<p>In the example below, you will see the <strong>text contains extra spaces<\/strong> at the beginning, middle, and even end of the sentence.<\/p>\n<p>Let&#8217;s <strong>remove the unwanted spaces and keep only a single space<\/strong> between words.<\/p>\n<p>Follow the step-by-step tutorial below on Excel remove trailing spaces and leading spaces and download this workbook to follow along:<\/p>\n<div class=\"after-post-box\"><a class=\"IRPP_minimalist icon-download button small\" href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/06\/How-to-Clean-Leading-and-Trailing-Spaces.xlsx\" target=\"_blank\" rel=\"noopener noreferrer\" data-leadbox=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/06\/How-to-Clean-Leading-and-Trailing-Spaces.xlsx\" data-leadbox-id=\"147284833f72a2:12f08263ab46dc\"><span class=\"ctaText px-3 text-capitalize\"><strong>download excel workbook<i class=\"fa fa-download\"><\/i><\/strong><\/span><span class=\"postTitle px-3\">How-to-Clean-Leading-and-Trailing-Spaces.xlsx<\/span><\/a><\/div>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff0000\"><strong>STEP 1:<\/strong> \u00a0<\/span>Enter the TRIM formula in cell C7.<\/p>\n<h3 style=\"text-align: center\"><span style=\"color: #0000ff\">=TRIM(<\/span><\/h3>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-2021-01-18-at-3.14.01-AM.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-22350 size-full\" title=\"How to Remove Leading and Trailing Spaces in Excel\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-2021-01-18-at-3.14.01-AM.png\" alt=\"How to Remove Leading and Trailing Spaces in Excel\" width=\"578\" height=\"197\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-2021-01-18-at-3.14.01-AM.png 578w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-2021-01-18-at-3.14.01-AM-300x102.png 300w\" sizes=\"(max-width: 578px) 100vw, 578px\" \/><\/a><\/p>\n<p><span style=\"color: #ff0000\"><strong>STEP 2:<\/strong> \u00a0<\/span>Enter the argument required for this formula &#8211; text from which you want extra spaces to be removed.<\/p>\n<h3 style=\"text-align: center\"><span style=\"color: #000000\">=TRIM(<\/span><span style=\"color: #0000ff\">B7)<\/span><\/h3>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-2021-01-18-at-3.15.38-AM.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-22351 size-full\" title=\"How to Remove Leading and Trailing Spaces in Excel\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-2021-01-18-at-3.15.38-AM.png\" alt=\"How to Remove Leading and Trailing Spaces in Excel\" width=\"599\" height=\"212\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-2021-01-18-at-3.15.38-AM.png 599w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-2021-01-18-at-3.15.38-AM-300x106.png 300w\" sizes=\"(max-width: 599px) 100vw, 599px\" \/><\/a><\/p>\n<p>The spaces get removed with no issues:<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-2021-01-18-at-3.18.53-AM.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-22352 size-full\" title=\"How to Remove Leading and Trailing Spaces in Excel\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-2021-01-18-at-3.18.53-AM.png\" alt=\"How to Remove Leading and Trailing Spaces in Excel\" width=\"567\" height=\"171\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-2021-01-18-at-3.18.53-AM.png 567w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-2021-01-18-at-3.18.53-AM-300x90.png 300w\" sizes=\"(max-width: 567px) 100vw, 567px\" \/><\/a><\/p>\n<p><span style=\"color: #ff0000\"><strong>STEP 3:<\/strong> \u00a0<\/span>Now, <strong>copy-paste\u00a0the formula below<\/strong> to the <a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/combining-cell-ranges-in-excel\/\" target=\"_blank\" rel=\"noopener\">cell range<\/a> C7:C10.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-2021-01-18-at-3.16.17-AM.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-22353 size-full\" title=\"How to Remove Leading and Trailing Spaces in Excel\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-2021-01-18-at-3.16.17-AM.png\" alt=\"How to Remove Leading and Trailing Spaces in Excel\" width=\"580\" height=\"189\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-2021-01-18-at-3.16.17-AM.png 580w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-2021-01-18-at-3.16.17-AM-300x98.png 300w\" sizes=\"(max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>That&#8217;s it!<\/p>\n<p>All the unwanted spaces are gone.<\/p>\n<p>&nbsp;<\/p>\n<p>It is <strong>quite easy to Excel remove trailing spaces and leading spaces<\/strong> using the Trim function.<\/p>\n<p>In the example below, we have used the TRIM function on both cell D7 and cell D8.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-33.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-22376\" title=\"How to Remove Leading and Trailing Spaces in Excel\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-33.png\" alt=\"How to Remove Leading and Trailing Spaces in Excel\" width=\"385\" height=\"137\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-33.png 744w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-33-300x107.png 300w\" sizes=\"(max-width: 385px) 100vw, 385px\" \/><\/a> \u00a0<a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-32.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-22377\" title=\"How to Remove Leading and Trailing Spaces in Excel\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-32.png\" alt=\"How to Remove Leading and Trailing Spaces in Excel\" width=\"382\" height=\"138\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-32.png 750w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-32-300x108.png 300w\" sizes=\"(max-width: 382px) 100vw, 382px\" \/><\/a><\/p>\n<p>Since cell D8 has <strong>non-breaking spaces<\/strong>, the <strong>TRIM formula will not remove these spaces. <\/strong>The leading space is still there!<\/p>\n<p>The trim function can only remove normal spaces (ASCII character code 32). Non-breaking space has an ASCII character code 160 and it cannot be removed using the trim function.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>What are non-breaking spaces you ask?<\/strong><\/p>\n<p>Sometimes data downloaded as text uses non-breaking spaces for formatting purposes i.e. it prevents an automatic <a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/remove-line-breaks-in-excel\/\" target=\"_blank\" rel=\"noopener\">line break<\/a> in between these spaces.<\/p>\n<p>This is represented by <strong>CHAR(160)<\/strong>:<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/06\/How-to-Clean-Leading-and-Trailing-Spaces-03.jpg\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6495\" title=\"How to Remove Leading and Trailing Spaces in Excel\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/06\/How-to-Clean-Leading-and-Trailing-Spaces-03.jpg\" alt=\"How to Remove Leading and Trailing Spaces in Excel\" width=\"842\" height=\"35\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/06\/How-to-Clean-Leading-and-Trailing-Spaces-03.jpg 842w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/06\/How-to-Clean-Leading-and-Trailing-Spaces-03-300x12.jpg 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/06\/How-to-Clean-Leading-and-Trailing-Spaces-03-768x32.jpg 768w\" sizes=\"(max-width: 842px) 100vw, 842px\" \/><\/a><\/p>\n\n<p><strong>This looks like a pain! How do we clean these?<\/strong><\/p>\n<p>Let&#8217;s move forward and understand how to remove non-breaking spaces using SUBSTITUTE below!<\/p>\n<h3><span style=\"color: #339966\"><strong><a id=\"substitute-function-to-remove-non-breaking-spaces\"><\/a>Substitute Function to Remove <\/strong><strong>Non-Breaking Spaces<\/strong><\/span><\/h3>\n<div class=\"after-post-box\">\n<p class=\"line-two\">We will use the <strong><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/cleaning-data-excels-substitute-formula\/\" target=\"_blank\" rel=\"noopener noreferrer\">SUBSTITUTE Formula<\/a>\u00a0<\/strong>to remove the non-breaking spaces depicted by\u00a0<strong>CHAR(160).<\/strong><\/p>\n<\/div>\n<p>The goal is to replace the non-breaking spaces with normal spaces.<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff0000\"><strong>STEP 1:<\/strong> <\/span>Enter the <strong><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/count-text-occurrences-excels-substitute-formula\/\" target=\"_blank\" rel=\"noopener\">SUBSTITUTE formula<\/a><\/strong> in cell D9.<\/p>\n<h3 style=\"text-align: center\"><span style=\"color: #0000ff\">=SUBSTITUTE(<\/span><\/h3>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-40.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-22378 size-full\" title=\"How to Remove Leading and Trailing Spaces in Excel\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-40.png\" alt=\"How to Remove Leading and Trailing Spaces in Excel\" width=\"670\" height=\"269\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-40.png 670w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-40-300x120.png 300w\" sizes=\"(max-width: 670px) 100vw, 670px\" \/><\/a><\/p>\n<p><span style=\"color: #ff0000\"><strong>STEP 2:<\/strong> <\/span>Enter the<strong> first argument<\/strong> &#8211; the cell that contains the text you wish to substitute.<\/p>\n<h3 style=\"text-align: center\"><span style=\"color: #000000\">=SUBSTITUTE(<span style=\"color: #0000ff\">C9<\/span><\/span><\/h3>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-41.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-22380 size-full\" title=\"How to Remove Leading and Trailing Spaces in Excel\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-41.png\" alt=\"How to Remove Leading and Trailing Spaces in Excel\" width=\"668\" height=\"267\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-41.png 668w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-41-300x120.png 300w\" sizes=\"(max-width: 668px) 100vw, 668px\" \/><\/a><\/p>\n<p><span style=\"color: #ff0000\"><strong>STEP 3:<\/strong> <\/span>Enter the <strong>second argument<\/strong> &#8211; the existing text you wish to substitute.<\/p>\n<h3 style=\"text-align: center\"><span style=\"color: #000000\">=SUBSTITUTE(C9,<span style=\"color: #0000ff\">CHAR(160),<\/span><\/span><\/h3>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-42.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-22381 size-full\" title=\"How to Remove Leading and Trailing Spaces in Excel\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-42.png\" alt=\"How to Remove Leading and Trailing Spaces in Excel\" width=\"668\" height=\"272\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-42.png 668w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-42-300x122.png 300w\" sizes=\"(max-width: 668px) 100vw, 668px\" \/><\/a><\/p>\n<p><span style=\"color: #ff0000\"><strong>STEP 4:<\/strong> <\/span>Enter the <strong>third<\/strong> <strong>argument<\/strong> &#8211; the new text you wish to replace with.<\/p>\n<h3 style=\"text-align: center\"><span style=\"color: #000000\">=SUBSTITUTE(C9,CHAR(160),<\/span><span style=\"color: #000000\"><span style=\"color: #0000ff\">&#8221; &#8220;)<\/span><\/span><\/h3>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-46.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-22383 size-full\" title=\"How to Remove Leading and Trailing Spaces in Excel\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-46.png\" alt=\"How to Remove Leading and Trailing Spaces in Excel\" width=\"693\" height=\"315\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-46.png 693w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-46-300x136.png 300w\" sizes=\"(max-width: 693px) 100vw, 693px\" \/><\/a><\/p>\n<p><em><strong>Note:<\/strong> CHAR(160) represent non-breaking spaces in a text.<\/em><\/p>\n<p><span style=\"color: #ff0000\"><strong>STEP 5:<\/strong><\/span>\u00a0Now that we do not have the non-breaking spaces anymore, let us use the\u00a0<strong><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/cleaning-data-with-the-trim-formula-excel\/\" target=\"_blank\" rel=\"noopener noreferrer\">TRIM Formula<\/a><\/strong>!<\/p>\n<h3 style=\"text-align: center\"><span style=\"color: #0000ff\">=TRIM(<span style=\"color: #000000\">SUBSTITUTE(C9,\u00a0CHAR(160), &#8221; &#8220;)<\/span>)<\/span><\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-6502 size-full\" title=\"How to Remove Leading and Trailing Spaces in Excel\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/06\/How-to-Clean-Leading-and-Trailing-Spaces-06-1.jpg\" alt=\"How to Remove Leading and Trailing Spaces in Excel\" width=\"633\" height=\"149\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/06\/How-to-Clean-Leading-and-Trailing-Spaces-06-1.jpg 633w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/06\/How-to-Clean-Leading-and-Trailing-Spaces-06-1-300x71.jpg 300w\" sizes=\"(max-width: 633px) 100vw, 633px\" \/><\/p>\n<p>Now all of your\u00a0leading and trailing spaces are cleaned up!<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-6499 size-full\" title=\"How to Remove Leading and Trailing Spaces in Excel\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/06\/How-to-Clean-Leading-and-Trailing-Spaces-07.jpg\" alt=\"How to Remove Leading and Trailing Spaces in Excel\" width=\"588\" height=\"138\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/06\/How-to-Clean-Leading-and-Trailing-Spaces-07.jpg 588w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/06\/How-to-Clean-Leading-and-Trailing-Spaces-07-300x70.jpg 300w\" sizes=\"(max-width: 588px) 100vw, 588px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><span style=\"color: #339966\"><strong><a id=\"find-replace-to-remove-all-spaces\"><\/a>Find &amp; Replace to remove all spaces<\/strong><\/span><\/h3>\n<p>You can <strong>use the find and replace feature<\/strong> in Excel to amend data within seconds. In the example below, you have a list of few numbers and you wish to remove any spaces between these numbers.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-2021-01-18-at-4.50.16-AM.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-22363 size-full\" title=\"How to Remove Leading and Trailing Spaces in Excel\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-2021-01-18-at-4.50.16-AM.png\" alt=\"How to Remove Leading and Trailing Spaces in Excel\" width=\"331\" height=\"203\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-2021-01-18-at-4.50.16-AM.png 331w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-2021-01-18-at-4.50.16-AM-300x184.png 300w\" sizes=\"(max-width: 331px) 100vw, 331px\" \/><\/a><\/p>\n<p>To remove all <a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/remove-text-in-excel\/\" target=\"_blank\" rel=\"noopener\">space<\/a> characters from a cell, follow the steps below:<\/p>\n<p><span style=\"color: #ff0000\"><strong>STEP 1:<\/strong><\/span> Select the cell range from which you want to remove spaces.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-27.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-22369 size-full\" title=\"How to Remove Leading and Trailing Spaces in Excel\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-27.png\" alt=\"How to Remove Leading and Trailing Spaces in Excel\" width=\"421\" height=\"273\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-27.png 421w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-27-300x195.png 300w\" sizes=\"(max-width: 421px) 100vw, 421px\" \/><\/a><\/p>\n<p><span style=\"color: #ff0000\"><strong>STEP 2:<\/strong><\/span> Go to\u00a0\u00a0<strong>Home &gt; Find &amp; Select &gt; Replace<\/strong> or <strong>Press Ctrl + H<\/strong> to open the Find &amp; Replace dialog box.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-28.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-22370 size-full\" title=\"How to Remove Leading and Trailing Spaces in Excel\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-28.png\" alt=\"How to Remove Leading and Trailing Spaces in Excel\" width=\"442\" height=\"195\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-28.png 442w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-28-300x132.png 300w\" sizes=\"(max-width: 442px) 100vw, 442px\" \/><\/a><\/p>\n<p><span style=\"color: #ff0000\"><strong>STEP 3:<\/strong><\/span> Press the<strong> Space bar in the Find what<\/strong> field to insert a space and keep the<strong> Replace with field empty<\/strong>.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-29-1.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-22372 size-full\" title=\"How to Remove Leading and Trailing Spaces in Excel\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-29-1.png\" alt=\"How to Remove Leading and Trailing Spaces in Excel\" width=\"441\" height=\"193\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-29-1.png 441w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-29-1-300x131.png 300w\" sizes=\"(max-width: 441px) 100vw, 441px\" \/><\/a><\/p>\n<p><span style=\"color: #ff0000\"><strong>STEP 4:<\/strong><\/span> Click the Replace All button and then click OK.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-31.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-22373 size-full\" title=\"How to Remove Leading and Trailing Spaces in Excel\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-31.png\" alt=\"How to Remove Leading and Trailing Spaces in Excel\" width=\"442\" height=\"194\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-31.png 442w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-31-300x132.png 300w\" sizes=\"(max-width: 442px) 100vw, 442px\" \/><\/a><\/p>\n<p>All the spaces are now removed!<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-30.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-22374 size-full\" title=\"How to Remove Leading and Trailing Spaces in Excel\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-30.png\" alt=\"How to Remove Leading and Trailing Spaces in Excel\" width=\"392\" height=\"252\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-30.png 392w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/Screenshot-30-300x193.png 300w\" sizes=\"(max-width: 392px) 100vw, 392px\" \/><\/a><\/p>\n<p>This is how you can <a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/remove-whitespace-in-regex\/\" target=\"_blank\" rel=\"noopener\">Excel remove<\/a> trailing spaces, trailing spaces, and non-breaking spaces, too!<\/p>\n<p>&nbsp;<\/p>\n<h3><span style=\"color: #339966\">Conclusion<\/span><\/h3>\n<p>Using the <a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/top-excel-formulas-function-examples-to-get-better-at-microsoft-excel\/\" target=\"_blank\" rel=\"noopener\"><strong>Trim function<\/strong><\/a>, you have learned how to remove trailing spaces in Excel and leading spaces too.<\/p>\n<p>There can be non-breaking spaces in a text as well. To remove them, simply use <strong>Substitute Function<\/strong> and replace the non-breaking space with a normal space.<\/p>\n<p>Lastly, if you wish to remove all spaces in Excel the <strong>Find &amp; Replace<\/strong> feature would be your best match!<\/p>\n<p>Give these methods a try and become a pro in <a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/cleaning-data-excels-clean-formula\/\" target=\"_blank\" rel=\"noopener\">cleaning data in MS Excel<\/a>!<\/p>\n<p><strong>Further Learning:<\/strong><\/p>\n<ul>\n<li><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/clean-data-set\/\" target=\"_blank\" rel=\"noopener\">Clean Data Set for Pivot Table<\/a><\/li>\n<li><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/top-excel-data-cleansing-techniques\/\" target=\"_blank\" rel=\"noopener\">Top Excel Data Cleansing Techniques<\/a><\/li>\n<li><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/split-string-in-excel\/\" target=\"_blank\" rel=\"noopener\">5 Effective Ways to Split String in Excel for Better Data Management<\/a><\/li>\n<\/ul>\n<p><strong>Make sure to download our FREE PDF on the<a href=\"https:\/\/app.monstercampaigns.com\/c\/czseo0viyrmspcx5ndve\/\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">\u00a0333 Excel keyboard Shortcuts here<\/a>:<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Excel, you may sometimes find unwanted and extra spaces in your data. It might take a considerable amount of time to clean this data and make it perfect for further analysis. So, it is extremely important to Excel remove trailing spaces! Leading spaces (at the start of the text), Trailing spaces (at the end [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":17281,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"cos_headline_score":0,"cos_seo_score":0,"cos_headline_text":"How to Remove Leading and Trailing Spaces in Excel","cos_headline_has_been_analyzed":false,"cos_last_analyzed_headline":[],"om_disable_all_campaigns":false},"categories":[6,3,7,10,41,306,14,308],"tags":[258,259],"acf":[],"_links":{"self":[{"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/posts\/6490"}],"collection":[{"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/comments?post=6490"}],"version-history":[{"count":0,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/posts\/6490\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/media\/17281"}],"wp:attachment":[{"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/media?parent=6490"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/categories?post=6490"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/tags?post=6490"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}