Excel - TEXTSPLIT Function



TEXTSPLIT Function

The EXCEL TEXTSPLIT function allows you to partition the text horizontally or vertically, depending on the delimiter. For example, you import the dataset from the ZSG hospital, where all the crucial information for the patients tests is given in a single row. You can deploy the TEXTSPLIT function to extract only the users' blood group and HB level. The massive advantages of the TEXTSPLIT function are that it saves users precious time, increases readability, and allows multiple delimiters to be utilized without any cumbersome issues.

Compatibility

The TEXTSPLIT function is compatible with the various versions of MS Excel.

  • Excel for Microsoft 365
  • Excel for Microsoft 365 for Mac
  • Excel for the web

Syntax

The syntax of the TEXTSPLIT function is given below −

=TEXTSPLIT(text,col_delimiter,[row_delimiter],[ignore_empty], [match_mode], [pad_with])

Arguments

You may utilize the following arguments with the TEXTSPLIT function −

Argument Description Required / Optional
Text A text string for partitioning the text. Required
col_delimiter It indicates a text that acts as a pointer to partition the input string across the columns. Required
row_delimiter It indicates a text that acts as a marker to partition the input string downwards. Optional
ignore_empty It contains logical values, either True or False. To avoid the continuous sequence of delimiters, set its value to True. Otherwise, set False(by default) to create an empty cell. Optional
match_mode By default, False is employed for an exact match. Otherwise, set True to ignore case differences. Optional
pad_with It represents a specific value to pad the output. Optional

TEXTSPLIT Function not Working in Excel

  • If the delimiter defined in the second and third arguments is not presented in the input string, then the TEXTSPLIT function will return the exact input string without splitting the input text.
  • The TEXTSPLIT function will not work if the first argument refers to an invalid cell reference.
  • The earlier Excel versions dont have the TEXTSPLIT function's built-in capability, so it will not work in the older Excel version.
  • If the match_mode argument contains text other than logical values, then the TEXTSPLIT function will retrieve the #VALUE! error.
  • The TEXTSPLIT function is case-sensitive, which means that upper and lowercase characters are interpreted differently during evaluation.

Examples of TEXTSPLIT Function in Excel

Practice the following example to learn the use of the TEXTSPLIT function in Excel.

Example 1

Using multiple delimiters in the input string

Solution

Step 1 − Let's say you downloaded the Excel worksheet from the internet. However, when you open it, the fundamental details of the patients are shown in a single column. The main motive is to segregate the values according to the delimiters and populate the values in the different columns.

Values in The Different Columns

Step 2 − First, write the formula =TEXTSPLIT(A2,{"/","-"}) in the B2 cell.

Write The Formula in the B2 Cell

Once you press the Enter tab, the merged value in the A2 cell will be split into consecutive columns based on the delimiters / and -.

A2 Cell will be split into Consecutive Columns

Step 3 − After that, drag the + sign at the lower right of the B2 cell, place it into the B6 cell to fill in similar results, and press the Enter tab.

B6 Cell to Fill in Similar Results

Press the Enter Tab

Example 2: Case Insensitivity

Enter the formula =TEXTSPLIT(A2,"S") in the B2 cell. Here, the second argument is S characters in uppercase. However, the input string contains the lowercase s character.

Input String Contains The Lowercase

Therefore, when you execute the TEXTSPLIT function, the exact text string will be populated like this.

Exact Text String will be Populated

To overcome this problem, you can set the match_mode argument to 1 so that upper and lower case letters are treated as identical. Write the formula =TEXTSPLIT(A2,"S",,,1) in the B2 cell and hit the Enter button.

Hit The Enter Button

Therefore, the TEXTSPLIT function splits the input, ignores case sensitivity, and populates the input text into multiple cells.

Download Practice Sheet

You can download and use the sample data sheet to practice the TEXTSPLIT function.

Advertisements