Find position of a character within the worksheet cell

C

Christmas May

If you have a cell whose contents contain a sentence of text with several
spaces, how can you find the position of the last space?

Thanks in advance,

Christmas May
 
M

Mike H

Try

=FIND(CHAR(1),SUBSTITUTE(A1," ",CHAR(1),LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))

As you posted in programming here's a VB solution

Lastspace = Len(Left(Range("A1"), InStrRev(Range("A1"), " ") - 1)) + 1

Mike

Mike
 

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