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))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top