{"id":3571,"date":"2016-07-04T01:39:20","date_gmt":"2016-07-03T23:39:20","guid":{"rendered":"https:\/\/www.myexcelonline.com\/?p=3571"},"modified":"2023-11-30T21:28:30","modified_gmt":"2023-11-30T20:28:30","slug":"cleaning-data-with-the-trim-formula-excel","status":"publish","type":"post","link":"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/cleaning-data-with-the-trim-formula-excel\/","title":{"rendered":"Cleaning Data with Excel&#8217;s TRIM Formula"},"content":{"rendered":"<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(<span style=\"color: #ff0000;\">text<\/span>)<\/p>\n<p><em><strong>What it means:<\/strong><\/em><\/p>\n<p>=TRIM(<span style=\"color: #ff0000;\">text that you want extra spaces to be removed<\/span>)<\/p>\n<hr \/>\n<p>In the quest for cleaner data, one of the common scenarios is removing extra spaces in our text.<\/p>\n<p><strong>Extra spaces are very difficult to spot<\/strong>, especially those at the end. The <strong>TRIM <\/strong>formula\u00a0in Excel is one of the Data Cleansing\u00a0functions and is great if you want to remove extra spaces from text whether it be from the start, middle or at the end of the text.<\/p>\n<p>In a nutshell, the <strong>TRIM<\/strong> function in Excel removes unneeded spaces in your text, except single spaces between words.<\/p>\n<p>This is how it is done below (go to the bottom of the page if you want to see the animated gif tutorial):<\/p>\n<p><iframe src=\"https:\/\/www.youtube.com\/embed\/YE2V-5_u4ug?rel=0 \" width=\"800\" height=\"400\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><span data-mce-type=\"bookmark\" style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" class=\"mce_SELRES_start\">\ufeff<\/span><\/iframe><\/p>\n<p><a href=\"https:\/\/www.youtube.com\/c\/MyExcelOnlinecomtutorials?sub_confirmation=1\" target=\"_blank\" rel=\"noopener noreferrer nofollow\"><img loading=\"lazy\" decoding=\"async\" class=\"alignmiddle wp-image-111468 size-full\" style=\"vertical-align: middle;\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/04\/1.yt_.png\" alt=\"\" title=\"\"><\/a><br \/>\n<a class=\"IRPP_minimalist icon-download\" href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/06\/Trim.xlsx\" target=\"_blank\"><span class=\"ctaText px-3 text-capitalize\">Download excel workbook<\/span><span class=\"postTitle px-3\">Trim.xlsx<\/span><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff0000;\"><strong>STEP 1:<\/strong> <\/span>We need to <strong>enter the <em>Trim\u00a0<\/em>function<\/strong><\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_57_1 counter-flat ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li><a href=\"#\" class=\"scroll-to-download\">Free Practice Workbook<\/a><\/li><li class='ez-toc-page-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/cleaning-data-with-the-trim-formula-excel\/#TRIM\" title=\"=TRIM\">=TRIM<\/a><\/li><\/ul><\/nav><\/div>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"TRIM\"><\/span><span style=\"color: #0000ff;\">=TRIM<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"color: #ff0000;\"><strong>STEP 2:<\/strong><\/span>\u00a0The\u00a0Trim\u00a0argument &#8211; <strong>Which text do we want to remove the extra spaces?<\/strong><\/p>\n<p>This is our data source:<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/06\/Trim-01.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"Cleaning Data with Excel&#039;s TRIM Formula\"  class=\"size-full wp-image-3640 aligncenter\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/06\/Trim-01.png\" alt=\"Cleaning Data with Excel&#039;s TRIM Formula\" width=\"596\" height=\"192\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/06\/Trim-01.png 596w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/06\/Trim-01-300x97.png 300w\" sizes=\"(max-width: 596px) 100vw, 596px\" \/><\/a><\/p>\n<p><strong>Now place in the first cell as the argument for our Trim Formula.<\/strong><\/p>\n<h2 style=\"text-align: center;\">=TRIM(<span style=\"color: #0000ff;\">C9)<\/span><\/h2>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/06\/Trim-02.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"Cleaning Data with Excel&#039;s TRIM Formula\"  class=\"size-full wp-image-3641 aligncenter\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/06\/Trim-02.png\" alt=\"Cleaning Data with Excel&#039;s TRIM Formula\" width=\"592\" height=\"188\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/06\/Trim-02.png 592w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/06\/Trim-02-300x95.png 300w\" sizes=\"(max-width: 592px) 100vw, 592px\" \/><\/a><\/p>\n<p><span style=\"color: #ff0000;\"><strong>STEP 3:<\/strong> <\/span>Do the same for the rest of the cells by using the\u00a0<strong>TRIM\u00a0<\/strong>formula, notice all of the extra spaces have been removed:<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/06\/Trim-03.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"Cleaning Data with Excel&#039;s TRIM Formula\"  class=\"size-full wp-image-3642 aligncenter\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/06\/Trim-03.png\" alt=\"Cleaning Data with Excel&#039;s TRIM Formula\" width=\"598\" height=\"198\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/06\/Trim-03.png 598w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/06\/Trim-03-300x99.png 300w\" sizes=\"(max-width: 598px) 100vw, 598px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: left;\">\n","protected":false},"excerpt":{"rendered":"<p>What does it do? Removes unneeded spaces in your text, except single spaces in between words Formula breakdown: =TRIM(text) What it means: =TRIM(text that you want extra spaces to be removed) In the quest for cleaner data, one of the common scenarios is removing extra spaces in our text. Extra spaces are very difficult to [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":17468,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"cos_headline_score":0,"cos_seo_score":0,"cos_headline_text":"","cos_headline_has_been_analyzed":false,"cos_last_analyzed_headline":[],"om_disable_all_campaigns":false},"categories":[3,14,308],"tags":[118,43,70,141],"acf":[],"_links":{"self":[{"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/posts\/3571"}],"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=3571"}],"version-history":[{"count":0,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/posts\/3571\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/media\/17468"}],"wp:attachment":[{"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/media?parent=3571"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/categories?post=3571"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/tags?post=3571"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}