A way using only native Excel functions (the original source is this answer in Soen) that’s how it is:
=DIREITA(A2;NÚM.CARACT(A2)-PROCURAR("|";SUBSTITUIR(A2;" ";"|";NÚM.CARACT(A2)-NÚM.CARACT(SUBSTITUIR(A2;" ";"")))))
Detailing how it works, from left to right:
NÚM.CARACT(A2)-NÚM.CARACT(SUBSTITUIR(A2;" ";""))
- counts the total number of spaces in the original string
SUBSTITUIR(A2;" ";"|"; ... )
- Changes only the last space for the character |
, to differentiate it from the others (note that its original string cannot contain such a character, otherwise the formula does not work correctly).
PROCURAR("|"; ... )
- Finds the absolute position of that character |
added (and that was the last space in the original string)
DIREITA(A2;NÚM.CARACT(A2) - ... ))
- Returns all characters after that character |
(that is, the last whole word in the original string)
Also, since you are using Excel in English (where the comma is used as the decimal separator), you need to use the semicolon as the parameter separator in the formula.
The original reply in Soen also has suggestions on how to get around the case where there is no white space in the original string (apart from the use of commas, it may be that this is your "new" error mentioned in comment).
P.S.: In fact, this answer is basically the same solution suggested by
@Earendul in a comment, only translated to Excel in English.
Except for a big coincidence, the original credit is still from the author of the answer there on Soen.
=RIGHT(A2,LEN(A2)-FIND("*",SUBSTITUTE(A2," ","*",LEN(A2)-LEN(SUBSTITUTE(A2," ","")))))
– Franchesco
Did not, translated to pt =Right(A2,NÚM. CARACT(A2)-LOCALIZE("",SUBST(A2," ","";NÚM.CARACT(A2)-NÚM.CARACT(SUBST(A2," ","")))) and gave error :( @Earendul
– Ricardo Simoes