Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Replace Comma with Dash

172 views
Skip to first unread message

brettma...@gmail.com

unread,
Apr 18, 2008, 4:48:14 AM4/18/08
to
Hello,

Please can someone explain how I can replace commas with a dash/
hyphen. For example cell A1 contains "ABC,DEF,GHI". I would like
cell B1 to display "ABC-DEF-GHI".

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

I need to cound how many comma's are in the text and then replace
them. I know I could you a find and replace but I need a formula.
The number of commas in the text will vary. Sometimes there are 2
other times there are none.

Thanks,
Brett

Mike H

unread,
Apr 18, 2008, 5:03:00 AM4/18/08
to
Try,

Edit|Replace

Replace what ,
Replace with -

You now have a choice depending on the construction of your worksheet. You
can do a replace all but this will do precisely that even for commas you may
not want it to or you can step through with Find.

Mike

NoodNutt

unread,
Apr 18, 2008, 5:06:38 AM4/18/08
to
Check out Rick Rothstein's reply in your other post.

His answer works as I have tried it myself.

Mark.


Rick Rothstein (MVP - VB)

unread,
Apr 18, 2008, 5:26:16 AM4/18/08
to
Was something wrong with the answer I gave you (in your first posting) some
48 minutes before you posted this same question over again?

Rick


<brettma...@gmail.com> wrote in message
news:05938ac4-9cea-438c...@x41g2000hsb.googlegroups.com...

0 new messages