I'd be very tempted to do this in VB, via a user-defined function.
Something like this, perhaps (not very neat, but it works):
Function SplitOnCapitals(ByVal sWordToSplit As String, lElement As Long) As String
Dim sElements() As String
Dim lCharLoop As Long
Dim bFirstMatch As Boolean
Dim sTmp As String
If sWordToSplit = LCase(sWordToSplit) Then
SplitOnCapitals = sWordToSplit
Else
bFirstMatch = True
sTmp = Left(sWordToSplit, 1)
sWordToSplit = sWordToSplit & "A"
For lCharLoop = 2 To Len(sWordToSplit)
If Mid(sWordToSplit, lCharLoop, 1) = UCase(Mid(sWordToSplit, lCharLoop, 1)) Then
If bFirstMatch Then
ReDim sElements(1 To 1)
bFirstMatch = False
Else
ReDim Preserve sElements(1 To UBound(sElements) + 1)
End If
sElements(UBound(sElements)) = sTmp
sTmp = Mid(sWordToSplit, lCharLoop, 1)
Else
sTmp = sTmp & Mid(sWordToSplit, lCharLoop, 1)
End If
Next lCharLoop
If lElement > UBound(sElements) Then
SplitOnCapitals = ""
Else
SplitOnCapitals = sElements(lElement)
End If
End If
With this in a module you could use:
=SPLITONCAPITALS("ILikeIceCreamCones",3)
And it would return "Ice", the 3rd capitalized word in the string.
If your data was in cell A1 then you could go with:
=SPLITONCAPITALS($A1,COLUMN(A1))
And drag across 10 columns (or however many words you expect to have) and have it return each word in sequence.
Probably easier than trying to do it in formula.
Bookmarks