Place it inside a call to the LEFT function.Mr. jtakw
one more favor - what if I want to limit the letters to just the first 2 or 3
how would I adjust your formula?
many many thanks
For my formula forwhat if I want to limit the letters to just the first 2 or 3
Function GFL(rng As Range) As String
Dim arr
Dim I As Long
arr = VBA.Split(rng, " ")
If IsArray(arr) Then
For I = LBound(arr) To UBound(arr)
GFL = GFL & Left(arr(I), [color=red]1[/color])
Next I
Else
GFL = Left(arr, [color=red]1[/color])
End If
End Function
what if I want to limit the letters to just the first 2 or 3
how would I adjust your formula?
many many thanks
Cell Formulas | ||
---|---|---|
Range | Formula | |
B1 | =LEFT(A1,1)&LEFT(TRIM(MID(SUBSTITUTE(A1," ",REPT(" ",100)),100,100)),1)&LEFT(TRIM(MID(SUBSTITUTE(A1," ",REPT(" ",100)),200,100)),1)&LEFT(TRIM(MID(SUBSTITUTE(A1," ",REPT(" ",100)),300,100)),1)&LEFT(TRIM(MID(SUBSTITUTE(A1," ",REPT(" ",100)),400,100)),1) | |
C1 | =LEFT(A1,1)&IF(D$1>=2,LEFT(TRIM(MID(SUBSTITUTE(A1," ",REPT(" ",100)),100,100)),1),"")&IF(D$1>=3,LEFT(TRIM(MID(SUBSTITUTE(A1," ",REPT(" ",100)),200,100)),1),"")&IF(D$1>=4,LEFT(TRIM(MID(SUBSTITUTE(A1," ",REPT(" ",100)),300,100)),1),"")&IF(D$1>=5,LEFT(TRIM(MID(SUBSTITUTE(A1," ",REPT(" ",100)),400,100)),1),"") |
[SIZE=1]let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
SplitResult = Table.SplitColumn(Source, "Source" , Splitter.SplitTextByDelimiter(" "), 5 ),
#"Extracted First Characters" = Table.TransformColumns(SplitResult, {{"Source.1", each Text.Start(_, 1), type text}, {"Source.2", each Text.Start(_, 1), type text}, {"Source.3", each Text.Start(_, 1), type text}, {"Source.4", each Text.Start(_, 1), type text}, {"Source.5", each Text.Start(_, 1), type text}}),
#"Merged Columns" = Table.CombineColumns(#"Extracted First Characters",{"Source.1", "Source.2", "Source.3", "Source.4", "Source.5"},Combiner.CombineTextByDelimiter("", QuoteStyle.None),"Result"),
#"Uppercased Text" = Table.TransformColumns(#"Merged Columns",{{"Result", Text.Upper, type text}})
in
#"Uppercased Text"[/SIZE]