Inserting a space into a text string

B

Brian Anderson

Here is my question:

I am trying to insert a space at a specific point in a
text string. Please see example below.

Text string = ROF13734357/2R4A

The result I want is as follows:

Text string = ROF13734357/2 R4A

The problem is that I never know exactly what position
the "R" will be in or if there will be more than one "R"
in the text string.

Bottom line is, I want to insert a space immediately
BEFORE the LAST "R" in the text string. Any ideas?

This one has had me stumped for quite some time. Thanks.

Brian Anderson
 
N

Norman Harker

Hi Brian!

Try:
=SUBSTITUTE(A1,"R"," R",LEN(A1)-LEN(SUBSTITUTE(A1,"R","")))


--
--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 

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