Split Text String by Specified Character in Excel

This post explains how to split text string by a specified character (such as: comma, space, dash, slash, etc.) using FIND function within other functions in excel. And you will learn that how to extract part of characters to the left of a specified character in one cell.

Split Text String by Specified Character

When you want to split text string by a specified character, such as:  dash character, the most important thing is that how to get the position of the specified character (dash “-”) within the text string in one cell. So you can use the FIND function or SEARCH Function to get the position of the searched character within another string. Once you got the position number of the specified character, you can use the LEFT function to extract all the characters to the left of dash character (“-“).

So you should use the Left function in combination with FIND function to split the text string in excel. And we can refer to the below formula that will find the position of “-“in Cell B1 and extract all the characters to the left of the dash character “-“.

=LEFT(B1,FIND("-",B1,1)-1)

Suppose you have a list of student’s height in column B and you want to extract only the name part. You can use the above excel formula in Cell C1.

Split Text String by Specified Character1

In the above example, the FIND function will locate the position of the first dash character (“-“) in Cell B1, and then then LEFT function will use the returned position number of FIND function as the second argument to extract all the characters left (student’s name) to it.

The returned value of FIND function need to subtract 1, as we need to exclude the dash character “-“from the result of the LEFT function.

Of course, if you want to extract all characters to the right of dash character within the text string in Cell B1, you can use a combination of the RIGHT, LEN and FIND functions in excel.  Enter the below excel formula in Cell D1:

=RIGHT(B1, LEN(B1)-FIND("-",B1))

Split Text String by Specified Character2

In the above example, the FIND function will locate the position of the dash character in Cell B1. And the LEN Function will get the length of the text string in Cell B1. Then subtract the result of FIND function from the returned value of LEN function, so that it will get the number of characters from the rightmost character in Cell B1.


Related Formulas

  • Split Multiple Lines from a Cell into Rows
    If you have multiple lines in a cell and each line is separated by line break character or press “alt + enter” key while you entering the text string into cells, and you need to extract the multiple lines into the separated rows or columns, you can use a combination with the TRIM function, the MID function, the SUBSTITUTE function, the REPT function, the LEN function to create a complex excel formula..…
  • Split Text String to an Array
    If you want to convert a text string into an array that split each character in text as an element, you can use an excel formula to achieve this result. the below will guide you how to use a combination of the MID function, the ROW function, the INDIRECT function and the LEN function to split a string…
  • Split Text String by Line Break in Excel
    When you want to split text string by line break in excel, you should use a combination of the LEFT, RIGHT, CHAR, LEN and FIND functions. The CHAR (10) function will return the line break character, the FIND function will use the returned value of the CHAR function as the first argument to locate the position of the line break character within the cell B1.…
  • Split Text and Numbers
    If you want to split text and numbers, you can run the following excel formula that use the MIN function, FIND function and the LEN function within the LEFT function in excel. And if you want to extract only numbers within string, then you also need to RIGHT function to combine with the above functions..…

Related Functions

  • Excel Find function
    The Excel FIND function returns the position of the first text string (substring) from the first character of the second text string.The FIND function is a build-in function in Microsoft Excel and it is categorized as a Text Function.The syntax of the FIND function is as below:= FIND  (find_text, within_text,[start_num])…
  • Excel SEARCH function
    The Excel SEARCH function returns the number of the starting location of a substring in a text string.The syntax of the SEARCH function is as below:= SEARCH  (find_text, within_text,[start_num])…
  • Excel LEFT function
    The Excel LEFT function returns a substring (a specified number of the characters) from a text string, starting from the leftmost character.The LEFT function is a build-in function in Microsoft Excel and it is categorized as a Text Function.The syntax of the LEFT function is as below:= LEFT(text,[num_chars])…
  • Excel LEN function
    The Excel LEN function returns the length of a text string (the number of characters in a text string).The LEN function is a build-in function in Microsoft Excel and it is categorized as a Text Function.The syntax of the LEN function is as below:= LEN(text)…
  • Excel RIGHT function
    The Excel RIGHT function returns a substring (a specified number of the characters) from a text string, starting from the rightmost character.The syntax of the RIGHT function is as below:= RIGHT (text,[num_chars])…
Related Posts

If Cell Contains Certain Text OR Equals Certain Text

IF cell equals certain text IF function is frequently used in Excel worksheet to return “true value” or “false value” based on the logical test result. If you want to test values to see if they equal certain text like ...

How to Extract Text between Two Text Strings in Excel
extract text between two words1

This post will guide you how to extract text between two given text strings in Excel. How do I get text string between two words with a formula in Excel. Extract Text between Two Text Strings Assuming that you have ...

How to Return a Value If a Cell Contains a Specific Text in Excel
return value if cell contains certain value2

This post will guide you how to return a value if a cell contains a certain number or text string in Excel. How do I check if a Cell contains specific text and then return another specific text in another ...

Insert The File Path and Filename into Cell
insert filepath filename in cell5

This post will guide you how to insert the file path and filename into a cell in Excel. Or how to add a file path only in a specified cell with a formula in Excel. Or how to add the ...

Sort Cells by Specific word or words
sort cells by specific words5

This post will guide you how to sort cells or text values in a column based on a specific word even if the word is in the text string in the cell. How do I sort cells in a column ...

Highlight Rows
highlight rows9

This post will teach you how to highlight rows in a table with conditional formatting in Excel. You will learn that how to change the color of the entire rows if the value of cells in a specified column meets ...

How to replace all characters after the first specific character
replace after first commas3

This post will guide you how to replace all characters after the first match of a specific character with a new text string in excel. How to replace all substrings after the first occurrence of the comma character with another ...

How to extract text after the second or nth specific character (space or comma)
extract text after second comma2

In the previous post, we talked that how to extract text after the first occurrence of the comma character in excel. And this post explains that how to get a substring after the second or nth occurrence of the comma ...

How to extract text before the second or nth specific character (space or comma)
extract text before second comma4

Before we talked that how to extract text before the first space or comma character in excel. And this post will guide you how to extract a substring before the second or nth specific character, such as: space or comma ...

How to extract text after first comma or space
extract text after first comma11

In the previous post, we talked that how to extract substring before the first comma or space or others specific characters in excel. And this post will guide you how to extract text after the first comma or space character ...

Sidebar