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

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
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,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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