I am trying to split a string in an excel formula, something like I can do in many programming languages, e.g.
string words = \"some text\".split(\' \');
Some great worksheet-fu in the other answers but I think they've overlooked that you can define a user-defined function (udf) and call this from the sheet or a formula.
The next problem you have is to decide either to work with a whole array or with element.
For example this UDF function code
Public Function UdfSplit(ByVal sText As String, Optional ByVal sDelimiter As String = " ", Optional ByVal lIndex As Long = -1) As Variant
Dim vSplit As Variant
vSplit = VBA.Split(sText, sDelimiter)
If lIndex > -1 Then
UdfSplit = vSplit(lIndex)
Else
UdfSplit = vSplit
End If
End Function
allows single elements with the following in one cell
=UdfSplit("EUR/USD","/",0)
or one can use a blocks of cells with
=UdfSplit("EUR/USD","/")