Replace Comma with "-"

B

brettmanning24

Hello,

I would like to replace commas with a hyphen/dash. For example cell
A1 contains "ABC,DEF,GHI", I would like to replace the "," with "-"
i.e. "ABC,DEF,GHI".

I attempted to use REPLACE(A1,FIND(CHAR(","),A1),1,",") but this only
replaces the first ",".

I need to find out how many "," are in the text and replace them all.
I know I could use find and replace but I need to use a formula.

Thanks in advance,

Brett
 
F

FSt1

hi
use the substitute function.
if data in A2 then
=SUBSTITUTE(A2,",","-")
or substitute(text or cell, text to sub or ",", replacmetn text or "-",
number of instances. if number of instances is omitted, the formula replaces
all.

Regards
FSt1
 
M

Mike H

Hi,

I count that you've posted this question 6 times and have several solutions,
why don't you look at those?

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