Find nth occurrence and replace with ":"

M

marlea

I am altering REPLACE functions for different parts of my data. Thi
works OK, but it would be more efficient if I could apply one functio
to all of my data.

Data:
Column A
R1 volume measured by...
R4 mass times...
R11 weight is related...
R12 height
R100 distance and time
R124 force

I want to place a colon after the numbers; e.g., R1: volume...; R12
height. If I knew how to find the first occurrence of a space, I thin
I could just find those spaces and replace them with a colon and
space. My work-around is to use REPLACE this way:

I apply this formula to cells with one-digit numbers:
=REPLACE(A1, 3, 1, ": ")

Then I slightly change the formula for cells with two-digit numbers:
=REPLACE(A1, 4, 1, ": ") ... and so on.

Can someone show me a better way of doing this? Thank you
 
M

Myrna Larson

=SUBSTITUTE(A1," ",": ")

should work for numbers of any length and replace all spaces with colon and
space.
 
M

marlea

Ah, I see, I was supposed to use REPLACE with FIND. Thank you so much!
This is perfect!
 

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