Long winded Excel formula needs simplifying

This works for your examples:

=TEXT(-LOOKUP(2,-MID(TRIM(RIGHT(SUBSTITUTE(K3," ",REPT(" ",1000)),1000)),1,ROW($1:$15)))+1,"000L")

Another one using FILTERXML:

=TEXT(FILTERXML("<t><s>"&SUBSTITUTE(LEFT(K3,LEN(K3)-1)," ","</s><s>")&"</s></t>","//s[last()]")+1,"000")&"L"

enter image description here


I have the tested the following and I think it fulfills your criteria

=TEXT(SUBSTITUTE(TRIM(RIGHT(SUBSTITUTE(B3," ",REPT(" ",100)),100)), RIGHT(B3, 1), "")+1, "000")&"L"