Need help with replacing text

imerictoo

New Member
Joined
Jun 26, 2018
Messages
3
Hello All,

Need help with replacing text as I have tried some formulas as well as a simple find & replace.
I have a string within a cell:
abc\Joe,abc\Mary,abc\harry,abc\,abc\,abc\

I want to remove the ,abc\,abc\,abc\

Any ideas?

Thanks,
Eric
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Is this what you want or is it the next one?
Sheet1



AB
abc\Joe,abc\Mary,abc\harry,abc\,abc\,abc\JoeMaryharry

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:280px;"><col style="width:92px;"></colgroup>
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]1[/TD]

Spreadsheet Formulas
CellFormula
B1=SUBSTITUTE(SUBSTITUTE(A1,",abc",""),"abc","")


Excel tables to the web >> Excel Jeanie HTML 4
Excel Workbook
AB
1abc\Joe,abc\Mary,abc\harry,abc\,abc\,abc\abc\Joe,abc\Mary,abc\harry
Sheet1





 
Last edited:
Upvote 0
Maybe something like this:

Excel 2013/2016
AB
abc\Joe,abc\Mary,abc\harry,abc\,abc\,abc\\Joe\Mary\harry\

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]

</tbody>
Sheet1

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]B1[/TH]
[TD="align: left"]=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"abc",""),",",""),"",""),"","")[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]



The most inner iteration of the Substitute function is just in case you end up with 3 ""s together. If you'll have more than that, we may have to go a different route.

This is the actual formula I put in...it's not posting it right for some reason.

PHP:
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"abc",""),",",""),"\\",""),"\\\","")
 
Last edited:
Upvote 0
This assumes you have no spaces in the data you want to keep as in your example:

Code:
=SUBSTITUTE(TRIM(SUBSTITUTE(SUBSTITUTE(A1,",abc",""),"\"," "))," ","\")

If there are spaces like Joe Smith for example, then try this:

Code:
=SUBSTITUTE(SUBSTITUTE(TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1," ","~"),",abc",""),"\"," "))," ","\"),"~"," ")
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,744
Messages
6,174,253
Members
452,553
Latest member
red83

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top