Remove character from excel cell but ignore some words

kradclayton

New Member
Joined
Oct 2, 2020
Messages
11
Office Version
  1. 365
Platform
  1. Windows
Hi!
I am wondering if there is a way to build upon the function in excel where you can remove a certain character from cells, but ignore a word that has that character.

The situation is that for a company i database for, they have to use colourways in a specific format in one part of the database but different in another.
Example - greens|blues|greys
In the second part of the databasing we have to remove the "s" from the colours. This is simple with the following formula - =SUBSTITUTE(B3,"s","")
This would leave me with green|blue|grey which is what i need.

However, my dilemma comes to when we name a colourway "sand" - ie sands|greens

If i use the above formula it would return and|green because it removes the s.

Can you use a if statement to stop it removing the s from sands?

Thanks!
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Hi & welcome to MrExcel.
Will all the colours always have an s on the end?
 
Upvote 0
Ok, how about
Excel Formula:
=LEFT(SUBSTITUTE(B3&"|","s|","|"),LEN(SUBSTITUTE(B3&"|","s|","|"))-1)
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
On a similar note - would I be able to use a formula to remove / from a cell and change it to a ,
Example - Grass / Silk / Mineral

Needs to become - Grass, Silk, Mineral

Thanks!
 
Upvote 0
How about
Excel Formula:
=SUBSTITUTE(A2,"/",",")
 
Upvote 0

Forum statistics

Threads
1,224,595
Messages
6,179,798
Members
452,943
Latest member
Newbie4296

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