Automatic text splitting by specified delimiter (SPLITUP)

Below we find a function which helps to divide text on parties by specified delimiter.

For this open Visual Basic Editor (Alt+F11), insert the new blank module (Insert - Module) and copy there following code:

Function SPLITUP(Txt, Delimiter, n) As String
   Dim x As Variant
      x = Split(Txt, Delimiter)
      If n > 0 And n - 1 <= UBound(x) Then
        SPLITUP = x(n - 1)
      Else
        SPLITUP = ""
      End If
End Function

Save and return to Excel. Now in the user defined functions you can find our function SPLITUP().

SPLITUP(Text;Delimiter;Sequence_fragment_number), where

Text - text in the cell which will be splitted;

Delimiter - symbol by which we will divide the text;

Sequence_fragment_number - number which show a fragment which we want to get.

Related articles:

Breaking text on several columns
Separation of the text into parts
Text concatenating from different cells (CONCATENATE)
Text concatenation by the condition (CONCATIF)