Two Substitute Formulas in one cell

roxdrob

New Member
Joined
Mar 2, 2017
Messages
29
I need the below to read White, Blue, Red & Silver. I have used the =SUBSTITUTE(B4," &", ",",1) to remove the first one, but I can't figure out how to remove the second &. Please help. TIA



<colgroup><col width="64"><col width="203"></colgroup><tbody>
[TD="width: 64"]ADJ4
[/TD]
[TD="width: 203"]White & Blue & Red & Silver
[/TD]

</tbody>
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Hi,

Since you only gave 1 sample...if it's Always 4 words separated by commas, then use this:


Book1
AB
1White & Blue & Red & SilverWhite, Blue, Red & Silver
Sheet705
Cell Formulas
RangeFormula
B1=SUBSTITUTE(SUBSTITUTE(A1," &",","),","," &",3)
 
Upvote 0
Thanks a bunch. I tried a version of that and it wasn't working for me. Is that saying delete all but the 3rd &?

I do have other combos, like 1 & 2 "&"s, but I figured them out and was going to do an if/then formula to calculate them. Unless you know of an easier way. I'm having to do it in multiple steps.
 
Upvote 0
How about


Book1
AB
10White & Blue & Red & SilverWhite, Blue, Red & Silver
11Blue & Red & SilverBlue, Red & Silver
12Red & SilverRed & Silver
Sheet1
Cell Formulas
RangeFormula
B10=SUBSTITUTE(SUBSTITUTE(A10," &",","),","," &",LEN(A10)-LEN(SUBSTITUTE(A10,"&","")))
 
Upvote 0
B3 formula will work for any number of words:


Book1
AB
1White & Blue & Red & SilverWhite, Blue, Red & Silver
2
3WhiteWhite
4White & BlueWhite & Blue
5White & Blue & RedWhite, Blue & Red
6White & Blue & Red & SilverWhite, Blue, Red & Silver
7White & Blue & Red & Silver & BlackWhite, Blue, Red, Silver & Black
Sheet705
Cell Formulas
RangeFormula
B1=SUBSTITUTE(SUBSTITUTE(A1," &",","),","," &",3)
B3=IFERROR(SUBSTITUTE(SUBSTITUTE(A3," &",","),","," &",LEN(A3)-LEN(SUBSTITUTE(A3,"&",""))),A3)
 
Upvote 0
Solution
You're welcome, thanks for the feedback.

I'd like to make an improvement to my B3 formula in Post # 5 as follows:


Book1
AB
3WhiteWhite
4White & BlueWhite & Blue
5White & Blue & RedWhite, Blue & Red
6White & Blue & Red & SilverWhite, Blue, Red & Silver
7White & Blue & Red & Silver & BlackWhite, Blue, Red, Silver & Black
Sheet705
Cell Formulas
RangeFormula
B3=SUBSTITUTE(SUBSTITUTE(A3," &",","),","," &",MAX(1,LEN(A3)-LEN(SUBSTITUTE(A3,"&",""))))
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

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