Last piece of text in a string (multiple lengths)

B

Bob Freeman

I am trying to construct a formula which will return the last complete text
string from a cell of text
e.g. 'I like football' will return 'football'
The string to be returned can be of any length.

Many thanks
 
T

T. Valko

In other words, you want to extract the last word in the string?

Try this:

=TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",255)),255))
 
B

Bob Freeman

Perfect - thank you

T. Valko said:
In other words, you want to extract the last word in the string?

Try this:

=TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",255)),255))
 
Top