{"id":4336,"date":"2016-10-12T23:30:07","date_gmt":"2016-10-12T21:30:07","guid":{"rendered":"https:\/\/www.myexcelonline.com\/?p=4336"},"modified":"2023-11-30T21:18:40","modified_gmt":"2023-11-30T20:18:40","slug":"cleaning-data-excels-substitute-formula","status":"publish","type":"post","link":"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/cleaning-data-excels-substitute-formula\/","title":{"rendered":"Cleaning Data with Excel&#8217;s SUBSTITUTE Formula"},"content":{"rendered":"<p><em><strong>What does it do?<\/strong><\/em><\/p>\n<p>Substitutes new_text for old_text in a text string.<\/p>\n<p><em><strong>Formula breakdown:<\/strong><\/em><\/p>\n<p>=SUBSTITUTE(<span style=\"color: #0000ff;\">text<\/span>, <span style=\"color: #ff0000;\">old_text<\/span>, <span style=\"color: #339966;\">new_text<\/span>, <span style=\"color: #ff6600;\">[instance num]<\/span>)<\/p>\n<p><em><strong>What it means:<\/strong><\/em><\/p>\n<p>=SUBSTITUTE(<span style=\"color: #0000ff;\">This cell<\/span>, <span style=\"color: #ff0000;\">By this text character<\/span>, <span style=\"color: #339966;\">To this text character<\/span>,<span style=\"color: #ff6600;\"> [In the 1st, 2nd\u2026instance it occurs]<\/span>)<\/p>\n<hr \/>\n<p>When you needed to replace a specific text\u00a0in each word, and there is a pattern, Excel has just the formula for you.<\/p>\n<p>The <b>SUBSTITUTE\u00a0<\/b>formula in Excel can help you replace one specific text\u00a0with another easily.<\/p>\n<p>In our example below, we have a list of\u00a0part numbers.<\/p>\n<p>We want to replace the second dash<strong> \u00a0&#8211;<\/strong> \u00a0with the number sign \u00a0<strong>#<\/strong> . This formula is able to do this for us.<\/p>\n<p>I explain how you can do this and please\u00a0go to the bottom of the page to see the animated gif tutorial:<\/p>\n<div class=\"after-post-box\">\n<p><iframe src=\"https:\/\/www.youtube.com\/embed\/L4y6dbSaxtE?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><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><\/p>\n<p class=\"line-two\"><a class=\"IRPP_minimalist icon-download button small\" href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/09\/Substitute.xlsx\" target=\"_blank\" rel=\"noopener noreferrer\" data-leadbox=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/09\/Substitute.xlsx\" data-leadbox-id=\"147284833f72a2:12f08263ab46dc\"><span class=\"ctaText px-3 text-capitalize\"> download excel workbook <i class=\"fa fa-download\"><\/i><\/span><span class=\"postTitle px-3\">Substitute.xlsx<\/span><\/a><\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff0000;\"><strong>STEP 1:<\/strong> <\/span>We need to <strong>enter the <i>Substitute\u00a0<\/i>function <\/strong>next to the cell that we want to\u00a0clean\u00a0the data from:<\/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-excels-substitute-formula\/#SUBSTITUTE\" title=\"=SUBSTITUTE\">=SUBSTITUTE<\/a><\/li><li class='ez-toc-page-1'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/cleaning-data-excels-substitute-formula\/#text\" title=\"text\">text<\/a><\/li><li class='ez-toc-page-1'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/cleaning-data-excels-substitute-formula\/#_old_text\" title=\"\u00a0old_text\">\u00a0old_text<\/a><\/li><li class='ez-toc-page-1'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/cleaning-data-excels-substitute-formula\/#new_text\" title=\"new_text\">new_text<\/a><\/li><li class='ez-toc-page-1'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/cleaning-data-excels-substitute-formula\/#instance_num\" title=\"[instance num]\">[instance num]<\/a><\/li><\/ul><\/nav><\/div>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"SUBSTITUTE\"><\/span><span style=\"color: #0000ff;\">=SUBSTITUTE<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/09\/Substitute-01.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"Cleaning Data with Excel&#039;s SUBSTITUTE Formula\"  class=\"alignnone size-full wp-image-4339\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/09\/Substitute-01.png\" alt=\"Cleaning Data with Excel&#039;s SUBSTITUTE Formula\" width=\"451\" height=\"182\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/09\/Substitute-01.png 451w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/09\/Substitute-01-300x121.png 300w\" sizes=\"(max-width: 451px) 100vw, 451px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff0000;\"><strong>STEP 2:<\/strong><\/span>\u00a0The Substitute\u00a0arguments:<\/p>\n<h2><span class=\"ez-toc-section\" id=\"text\"><\/span><em><strong><span style=\"color: #0000ff;\">text<\/span><\/strong><\/em><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><strong>Which text\u00a0do we want to change?<\/strong><\/p>\n<p><em>Reference the cell that contains the text or value:<\/em><\/p>\n<h2 style=\"text-align: center;\"><span style=\"color: #000000;\">=SUBSTITUTE<\/span><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\/09\/Substitute-02.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"Cleaning Data with Excel&#039;s SUBSTITUTE Formula\"  class=\"alignnone size-full wp-image-4340\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/09\/Substitute-02.png\" alt=\"Cleaning Data with Excel&#039;s SUBSTITUTE Formula\" width=\"558\" height=\"173\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/09\/Substitute-02.png 558w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/09\/Substitute-02-300x93.png 300w\" sizes=\"(max-width: 558px) 100vw, 558px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"_old_text\"><\/span>\u00a0<em><strong><span style=\"color: #0000ff;\">old_text<\/span><\/strong><\/em><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><strong>Which text \/ characters do we want to replace?<\/strong><\/p>\n<p><em>We want to change the dash \u00a0<strong>&#8211;<\/strong> \u00a0so type it in with double quotations:<\/em><\/p>\n<h2 style=\"text-align: center;\"><span style=\"color: #000000;\">=SUBSTITUTE<\/span><span style=\"color: #0000ff;\"><span style=\"color: #000000;\">(C9,<\/span> &#8220;-&#8220;,<\/span><\/h2>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/09\/Substitute-03.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"Cleaning Data with Excel&#039;s SUBSTITUTE Formula\"  class=\"alignnone size-full wp-image-4341\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/09\/Substitute-03.png\" alt=\"Cleaning Data with Excel&#039;s SUBSTITUTE Formula\" width=\"557\" height=\"179\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/09\/Substitute-03.png 557w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/09\/Substitute-03-300x96.png 300w\" sizes=\"(max-width: 557px) 100vw, 557px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"new_text\"><\/span><em><strong><span style=\"color: #0000ff;\">new_text<\/span><\/strong><\/em><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><strong>Which text \/ characters do we want to replace it with?<\/strong><\/p>\n<p><em>We want to change it into the number sign \u00a0<strong>#<\/strong> \u00a0so type it in with double quotations:<\/em><\/p>\n<h2 style=\"text-align: center;\"><span style=\"color: #000000;\">=SUBSTITUTE<\/span><span style=\"color: #0000ff;\"><span style=\"color: #000000;\">(C9,<\/span> <span style=\"color: #000000;\">&#8220;-&#8220;,<\/span> &#8220;#&#8221;,<\/span><\/h2>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/09\/Substitute-04.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"Cleaning Data with Excel&#039;s SUBSTITUTE Formula\"  class=\"alignnone size-full wp-image-4342\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/09\/Substitute-04.png\" alt=\"Cleaning Data with Excel&#039;s SUBSTITUTE Formula\" width=\"553\" height=\"170\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/09\/Substitute-04.png 553w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/09\/Substitute-04-300x92.png 300w\" sizes=\"(max-width: 553px) 100vw, 553px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"instance_num\"><\/span><em><strong><span style=\"color: #0000ff;\">[instance num]<\/span><\/strong><\/em><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><strong>Which specific instance are we targeting the substitution on?<\/strong><\/p>\n<p><em>This parameter is optional. In our scenario, we want the second dash \u00a0<strong>&#8211;<\/strong> \u00a0only to be substituted. So place in the number <strong>2<\/strong>:<\/em><\/p>\n<h2 style=\"text-align: center;\"><span style=\"color: #000000;\">=SUBSTITUTE<\/span><span style=\"color: #0000ff;\"><span style=\"color: #000000;\">(C9,<\/span> <span style=\"color: #000000;\">&#8220;-&#8220;,<\/span> <span style=\"color: #000000;\">&#8220;#&#8221;,<\/span> 2)<\/span><\/h2>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/09\/Substitute-05.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"Cleaning Data with Excel&#039;s SUBSTITUTE Formula\"  class=\"alignnone size-full wp-image-4343\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/09\/Substitute-05.png\" alt=\"Cleaning Data with Excel&#039;s SUBSTITUTE Formula\" width=\"456\" height=\"177\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/09\/Substitute-05.png 456w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/09\/Substitute-05-300x116.png 300w\" sizes=\"(max-width: 456px) 100vw, 456px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff0000;\"><strong>STEP 3:<\/strong> <\/span>Do the same for the rest of the cells by dragging the <b>SUBSTITUTE\u00a0<\/b>formula all the way down using the left mouse button.<\/p>\n<p>Note that all of the parts\u00a0are now changed to your new part values:<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/09\/Substitute-06.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"Cleaning Data with Excel&#039;s SUBSTITUTE Formula\"  class=\"alignnone size-full wp-image-4344\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/09\/Substitute-06.png\" alt=\"Cleaning Data with Excel&#039;s SUBSTITUTE Formula\" width=\"480\" height=\"194\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/09\/Substitute-06.png 480w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/09\/Substitute-06-300x121.png 300w\" sizes=\"(max-width: 480px) 100vw, 480px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What does it do? Substitutes new_text for old_text in a text string. Formula breakdown: =SUBSTITUTE(text, old_text, new_text, [instance num]) What it means: =SUBSTITUTE(This cell, By this text character, To this text character, [In the 1st, 2nd\u2026instance it occurs]) When you needed to replace a specific text\u00a0in each word, and there is a pattern, Excel has [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":17632,"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,306,14],"tags":[142,174,70],"acf":[],"_links":{"self":[{"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/posts\/4336"}],"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=4336"}],"version-history":[{"count":0,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/posts\/4336\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/media\/17632"}],"wp:attachment":[{"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/media?parent=4336"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/categories?post=4336"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/tags?post=4336"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}