Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 " wrote: 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 |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
I count that you've posted this question 6 times and have several solutions, why don't you look at those? Mike " wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Replace Comma with "-". | Excel Discussion (Misc queries) | |||
no comma separator for ="total"&"$ "&sum(a1:a10) | Excel Worksheet Functions | |||
How to replace "#N/A" w "0"when vlookup couldn't find the match? | Excel Discussion (Misc queries) | |||
Replace dialog should put focus on "Find What" not "Replace With" | Excel Discussion (Misc queries) | |||
Can you replace "TRUE" with " " in an exact formula? | Excel Worksheet Functions |