{"id":5014,"date":"2020-01-27T15:09:20","date_gmt":"2020-01-27T15:09:20","guid":{"rendered":"http:\/\/officetuts.net\/excel\/?p=5014"},"modified":"2024-03-29T13:51:57","modified_gmt":"2024-03-29T13:51:57","slug":"split-text-to-columns-with-formulas","status":"publish","type":"post","link":"https:\/\/officetuts.net\/excel\/formulas\/split-text-to-columns-with-formulas\/","title":{"rendered":"Split Text to Columns With Formulas in Excel"},"content":{"rendered":"\n
Split-Text-to-Columns-With-Formulas<\/a>Download<\/a><\/div>\n\n\n\n

If you want to split the text into columns, you can use Text to Columns Wizard<\/a>. If you want to have more control over the way you split the text, you can use formulas to do it.<\/p>\n\n\n\n

In order to manipulate strings, you can use a few different\nfunctions, such as SEARCH<\/a>,\nLEN<\/a>, LEFT<\/a>, MID<\/a>, RIGHT<\/a>, REPT<\/a>, TRIM<\/a>, and SUBSTITUTE<\/a>.<\/p>\n\n\n\n

You can create formulas<\/a> with different combinations of these\nfunctions in order to deal with different name combinations, like: first, last\nand middle name, title, suffix, prefix, etc.<\/p>\n\n\n\n

In this lesson, I’m going to create a few formulas for\ndifferent situations.<\/p>\n\n\n\n

There is a great article about it on the official\nsupport site<\/a>.<\/p>\n\n\n\n

Text with delimiter<\/h2>\n\n\n\n

In this part of the tutorial, we are going to use the\nexample with text separated by delimiters.<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

You can split text, using the following formula.<\/p>\n\n\n\n

=TRIM(MID(SUBSTITUTE($A1,\";\",REPT(\" \",LEN($A1))),COLUMNS($A:A)*LEN($A1)-(LEN($A1)-1),LEN($A1)))<\/code><\/pre>\n\n\n\n

Place it in cell B1<\/strong> and autofill it to the rest of the cells. The result looks like this.<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

Analyze the formula<\/h2>\n\n\n\n

Because there are absolute references<\/a> to column A1<\/strong> ($A1<\/strong>) When you autofill the formula, everything stays the same, the only part that changes is COLUMNS($A:A)<\/strong>.<\/p>\n\n\n\n

First, let’s try the LEN<\/strong>\nfunction. It returns the number of characters in a cell.<\/p>\n\n\n\n

=LEN($A1)<\/strong> in our\ncase is 17<\/strong>.<\/p>\n\n\n\n

Replace this part with the number.<\/p>\n\n\n\n

=TRIM(MID(SUBSTITUTE($A1,\";\",REPT(\" \",17)),COLUMNS($A:A)*17-(17-1),17))<\/code><\/pre>\n\n\n\n

The REPT<\/strong> function inserts a string a specified number of times. In our case, the function inserts 17 spaces. Let’s change the formula.<\/p>\n\n\n\n

=TRIM(MID(SUBSTITUTE($A1,\";\",\"                 \"),COLUMNS($A:A)*17-(17-1),17))<\/code><\/pre>\n\n\n\n

Let’s analyze this formula.<\/p>\n\n\n\n

SUBSTITUTE($A1,\";\",\"                 \")<\/code><\/pre>\n\n\n\n

It will take the string and convert each “;” character to 17 spaces.<\/p>\n\n\n\n

\"1                 2                 3                 text                 4                 5                 6                 \"<\/code><\/pre>\n\n\n\n

The part COLUMNS($A1:A)<\/strong> will return the number of columns. When you autofill<\/a> the cells it will be:<\/p>\n\n\n\n

\n Formula<\/strong>\n <\/td>\n Result<\/strong>\n <\/td><\/tr>
\n COLUMNS($A1:A)\n <\/td>\n 1\n <\/td><\/tr>
\n COLUMNS($A1:B)\n <\/td>\n 2\n <\/td><\/tr>
\n COLUMNS($A1:C)\n <\/td>\n 3\n <\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

The MID<\/strong> function\nreturns the substring from a string given a starting position and length.<\/p>\n\n\n\n

If we use this formula.<\/p>\n\n\n\n

=MID(\"This is text\", 2, 5)<\/code><\/pre>\n\n\n\n

It will return:<\/p>\n\n\n\n

his i<\/code><\/pre>\n\n\n\n

Let’s take a look at what we have for column B1<\/strong> if we insert this formula.<\/p>\n\n\n\n

=MID(SUBSTITUTE($A1,\";\",REPT(\" \",LEN($A1))),COLUMNS($A:A)*LEN($A1)-(LEN($A1)-1),LEN($A1))<\/code><\/pre>\n\n\n\n

First element<\/h2>\n\n\n\n

The first argument in the MID<\/strong> function is a string. In our case, it’s the following string.<\/p>\n\n\n\n

\"1                 2                 3                 text                 4                 5                 6                 \"<\/code><\/pre>\n\n\n\n

The second argument is:<\/p>\n\n\n\n

COLUMNS($A:A)*17-(17-1)<\/code><\/pre>\n\n\n\n

It can be converted (for the first value) to:<\/p>\n\n\n\n

1 * 17 - 16 = 1<\/code><\/pre>\n\n\n\n

The third argument is 17<\/strong>. The formula takes 17 characters starting from the first one. This will give us the following substring.<\/p>\n\n\n\n

\"1                \"<\/code><\/pre>\n\n\n\n

Now we use the TRIM<\/strong> function to get rid of any space outside the character leaving us with 1<\/strong>.<\/p>\n\n\n\n

Fourth element<\/h2>\n\n\n\n

Let’s take a look at how it works for the third element.<\/p>\n\n\n\n

COLUMNS($A:A)*17-(17-1)<\/code><\/pre>\n\n\n\n

The fourth column returns 4<\/strong>.<\/p>\n\n\n\n

4 * 17 - 16 = 68 - 16 = 52<\/code><\/pre>\n\n\n\n

The formula takes 17 characters starting from position 52<\/strong>, giving us this substring.<\/p>\n\n\n\n

\"  text           \"<\/code><\/pre>\n\n\n\n

Use the TRIM<\/strong> function to get rid of unnecessary spaces.<\/p>\n","protected":false},"excerpt":{"rendered":"

If you want to split the text into columns, you can use Text to Columns Wizard. If you want to have more control…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[170,190],"yoast_head":"\nSplit Text to Columns With Formulas in Excel<\/title>\n<meta name=\"description\" content=\"Learn how to use formulas to split the text into columns in Excel, including functions like SEARCH, LEN, and SUBSTITUTE.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/officetuts.net\/excel\/formulas\/split-text-to-columns-with-formulas\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Split Text to Columns With Formulas in Excel\" \/>\n<meta property=\"og:description\" content=\"Learn how to use formulas to split the text into columns in Excel, including functions like SEARCH, LEN, and SUBSTITUTE.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/officetuts.net\/excel\/formulas\/split-text-to-columns-with-formulas\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-01-27T15:09:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-29T13:51:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2020\/01\/split-text-example.png\" \/>\n<meta name=\"author\" content=\"Tomasz Decker\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tomasz Decker\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/split-text-to-columns-with-formulas\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/split-text-to-columns-with-formulas\/\"},\"author\":{\"name\":\"Tomasz Decker\",\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"headline\":\"Split Text to Columns With Formulas in Excel\",\"datePublished\":\"2020-01-27T15:09:20+00:00\",\"dateModified\":\"2024-03-29T13:51:57+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/split-text-to-columns-with-formulas\/\"},\"wordCount\":450,\"publisher\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"image\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/split-text-to-columns-with-formulas\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2020\/01\/split-text-example.png\",\"keywords\":[\"file\",\"pinterest\"],\"articleSection\":[\"formulas\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/split-text-to-columns-with-formulas\/\",\"url\":\"https:\/\/officetuts.net\/excel\/formulas\/split-text-to-columns-with-formulas\/\",\"name\":\"Split Text to Columns With Formulas in Excel\",\"isPartOf\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/split-text-to-columns-with-formulas\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/split-text-to-columns-with-formulas\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2020\/01\/split-text-example.png\",\"datePublished\":\"2020-01-27T15:09:20+00:00\",\"dateModified\":\"2024-03-29T13:51:57+00:00\",\"description\":\"Learn how to use formulas to split the text into columns in Excel, including functions like SEARCH, LEN, and SUBSTITUTE.\",\"breadcrumb\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/split-text-to-columns-with-formulas\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/officetuts.net\/excel\/formulas\/split-text-to-columns-with-formulas\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/split-text-to-columns-with-formulas\/#primaryimage\",\"url\":\"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2020\/01\/split-text-example.png\",\"contentUrl\":\"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2020\/01\/split-text-example.png\",\"width\":221,\"height\":120},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/split-text-to-columns-with-formulas\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/officetuts.net\/excel\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Split Text to Columns With Formulas in Excel\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/officetuts.net\/excel\/#website\",\"url\":\"https:\/\/officetuts.net\/excel\/\",\"name\":\"\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/officetuts.net\/excel\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\",\"name\":\"Tomasz Decker\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g\",\"caption\":\"Tomasz Decker\"},\"logo\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/\"},\"description\":\"Spreadsheet and Python enthusiast.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Split Text to Columns With Formulas in Excel","description":"Learn how to use formulas to split the text into columns in Excel, including functions like SEARCH, LEN, and SUBSTITUTE.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/officetuts.net\/excel\/formulas\/split-text-to-columns-with-formulas\/","og_locale":"en_US","og_type":"article","og_title":"Split Text to Columns With Formulas in Excel","og_description":"Learn how to use formulas to split the text into columns in Excel, including functions like SEARCH, LEN, and SUBSTITUTE.","og_url":"https:\/\/officetuts.net\/excel\/formulas\/split-text-to-columns-with-formulas\/","article_published_time":"2020-01-27T15:09:20+00:00","article_modified_time":"2024-03-29T13:51:57+00:00","og_image":[{"url":"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2020\/01\/split-text-example.png"}],"author":"Tomasz Decker","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Tomasz Decker","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/officetuts.net\/excel\/formulas\/split-text-to-columns-with-formulas\/#article","isPartOf":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/split-text-to-columns-with-formulas\/"},"author":{"name":"Tomasz Decker","@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"headline":"Split Text to Columns With Formulas in Excel","datePublished":"2020-01-27T15:09:20+00:00","dateModified":"2024-03-29T13:51:57+00:00","mainEntityOfPage":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/split-text-to-columns-with-formulas\/"},"wordCount":450,"publisher":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"image":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/split-text-to-columns-with-formulas\/#primaryimage"},"thumbnailUrl":"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2020\/01\/split-text-example.png","keywords":["file","pinterest"],"articleSection":["formulas"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/officetuts.net\/excel\/formulas\/split-text-to-columns-with-formulas\/","url":"https:\/\/officetuts.net\/excel\/formulas\/split-text-to-columns-with-formulas\/","name":"Split Text to Columns With Formulas in Excel","isPartOf":{"@id":"https:\/\/officetuts.net\/excel\/#website"},"primaryImageOfPage":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/split-text-to-columns-with-formulas\/#primaryimage"},"image":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/split-text-to-columns-with-formulas\/#primaryimage"},"thumbnailUrl":"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2020\/01\/split-text-example.png","datePublished":"2020-01-27T15:09:20+00:00","dateModified":"2024-03-29T13:51:57+00:00","description":"Learn how to use formulas to split the text into columns in Excel, including functions like SEARCH, LEN, and SUBSTITUTE.","breadcrumb":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/split-text-to-columns-with-formulas\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/officetuts.net\/excel\/formulas\/split-text-to-columns-with-formulas\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/officetuts.net\/excel\/formulas\/split-text-to-columns-with-formulas\/#primaryimage","url":"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2020\/01\/split-text-example.png","contentUrl":"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2020\/01\/split-text-example.png","width":221,"height":120},{"@type":"BreadcrumbList","@id":"https:\/\/officetuts.net\/excel\/formulas\/split-text-to-columns-with-formulas\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/officetuts.net\/excel\/"},{"@type":"ListItem","position":2,"name":"Split Text to Columns With Formulas in Excel"}]},{"@type":"WebSite","@id":"https:\/\/officetuts.net\/excel\/#website","url":"https:\/\/officetuts.net\/excel\/","name":"","description":"","publisher":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/officetuts.net\/excel\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42","name":"Tomasz Decker","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g","caption":"Tomasz Decker"},"logo":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/"},"description":"Spreadsheet and Python enthusiast."}]}},"_links":{"self":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/5014"}],"collection":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/comments?post=5014"}],"version-history":[{"count":9,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/5014\/revisions"}],"predecessor-version":[{"id":17388,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/5014\/revisions\/17388"}],"wp:attachment":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/media?parent=5014"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/categories?post=5014"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/tags?post=5014"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}