How to remove a second and/or third comma

woutv

New Member
Joined
May 15, 2019
Messages
4
Hello

I have a big data file in excel with some 'weird' numbers
for example:
[TABLE="width: 120"]
<tbody>[TR]
[TD="width: 120"]4959,68,4611,9[/TD]
[/TR]
</tbody>[/TABLE]
Sometimes it's like this: 7500,7152,22
How can i remove the last commas so that only the first comma will stay?

Thanks in advance
Regards
Wout
****** id="cke_pastebin" style="position: absolute; top: 0px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">Ho[TABLE="width: 120"]
<tbody>[TR]
[TD="width: 120"]4959,68,4611,9

[/TD]
[/TR]
</tbody>[/TABLE]
</body>
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hey,

try this:
=SUBSTITUTE(SUBSTITUTE(A1,",","",2),",","",2)

Where A1 contains the number
 
Upvote 0
If you have 1,2,3, 4 or more commas:

=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,",","|",1),",",""), "|",",")
 
Upvote 0
@DanteAmor

Nice solution! Works very well for multiple commas, the only concern is if the text in question actually uses the pipe character "|" - if so then there will be commas added for every pipe. I am sure that this isn't a problem but just noting it as it's interesting.
 
Upvote 0
@DanteAmor

Nice solution! Works very well for multiple commas, the only concern is if the text in question actually uses the pipe character "|" - if so then there will be commas added for every pipe. I am sure that this isn't a problem but just noting it as it's interesting.

You're right, I used a little common character, but it can happen, to round it off, it could be a character combination: "@|" or something like that.
Thanks for the observation
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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