Remove Spaces Before a Comma Only

lucolem

New Member
Joined
Sep 7, 2012
Messages
12
Hello all,
I'm looking for a formula to remove a space, if it exists, before a comma. For instance, I need "Golden Retriever,Dog" to be "GoldenRetriever,Dog". I need it to only remove the space before the comma because there will be spaces after the comma that need to stay there. And there won't always be a space; don't know if that makes a difference.

Any ideas? Thanks!
 
Or maybe this if there are more than one space before the comma?

Excel Workbook
AB
2Golden Retriever,DogGoldenRetriever,Dog
3Golden Retriever,Dog is yellowGoldenRetriever,Dog is yellow
4Golden Retriever,Dog has 4 legsGoldenRetriever,Dog has 4 legs
5Greater Spotted Woodpecker,Bird lives in the woodsGreaterSpottedWoodpecker,Bird lives in the woods
Sheet1
 
Upvote 0

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Forum statistics

Threads
1,217,243
Messages
6,135,455
Members
449,934
Latest member
fernandy772

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