Below you will find a function that will help you split the text into parts based on the specified separator.
To add a macro, open the Visual Basic editor (Alt+F11), insert a new empty software module
Function GETSUBSTR(Txt, Delimiter, n) As String 'moonexcel.com.ua Dim x As Variant x = Split(Txt, Delimiter) If n > 0 And n - 1 <= UBound(x) Then GETSUBSTR = x(n - 1) Else GETSUBSTR = "" End If End Function
Save and return to Excel. Now in custom functions you can find our GETSUBSTR() function.
=GETSUBSTR(text; delimiter; sequence_number_of_fragment)
where: