Subsitute format

Emily

Active Member
Joined
Aug 28, 2002
Messages
304
The format for SUBSTITUTE should be, say:
SUBSTITUTE(A1, "0", "")

Why SUBSTITUTE(A1, {"0", "1", "2") , "") be accepted?

The substitute only replace the first element of the set, i.e 0 only.

Thanks.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
It seems you can't pass an array to SUBSTITUTE. Try:

=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"0",""),"1",""),"2","")
 
Upvote 0
I think that was my point. You can't pass an array to SUBSTITUTE if used alone - it only evaluates the first aray element.

But SUBSTITUTE nested within a function which accepts an array (eg SUMPRODUCT) returns an array to that function. I wasn't aware of that, so thanks for the link.
 
Upvote 0
But SUBSTITUTE nested within a function which accepts an array (eg SUMPRODUCT) returns an array to that function. I wasn't aware of that, so thanks for the link.

Andrew
Would you please give me an example.
Thanks
 
Upvote 0
There's one in your link:

=SUBSTITUTE(A1,RIGHT(A1,SUMPRODUCT((LEN(A1)-LEN(SUBSTITUTE(A1,{0,1,2,3,4,5,6,7,8,9},""))))),"")

The second SUBSTITUTE passes an array to SUMPRODUCT.
 
Upvote 0

Forum statistics

Threads
1,214,951
Messages
6,122,449
Members
449,083
Latest member
Ava19

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