Inserting a space into a text string

  • Thread starter Thread starter Brian Anderson
  • Start date Start date
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
 
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.
 
Back
Top