repeating substitute funtion to change cell properly , iterativey by different non-uniform instance numbers (positions)

Spyros13

Board Regular
Joined
Mar 12, 2014
Messages
175
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Is there an already established udf/quick way I can substitute by (or on) instance number(s)?

My head drowned/blew up understood the complexity of this, on the 3rd iteration of this so i stopped. The 3rd nested substitute with if-test would need to contain the proceeding 2 if not if-test met, and so on... It would become like a program.

=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(IF(ISNUMBER(CW24),SUBSTITUTE(IF(ISNUMBER(CV24),SUBSTITUTE(AT24,"; "," - additional text added on if test is met"&"; ",COLUMN(A1000)),AT24),"; "," - additional text added on if test is met"&"; ",COLUMN(B1000)),IF(ISNUMBER(CV24),SUBSTITUTE(AT24,"; "," - additional text added on if test is met"&"; ",COLUMN(A1000)),AT24)),"; "," - additional text added on if test is met"&"; ",COLUMN(C1000)),"; "," - additional text added on if test is met"&"; ",COLUMN(D1000)),"; "," - additional text added on if test is met"&"; ",COLUMN(E1000)),"; "," - additional text added on if test is met"&"; ",COLUMN(G1000)),"; "," - additional text added on if test is met"&"; ",COLUMN(H1000)),"; "," - additional text added on if test is met"&"; ",COLUMN(I1000)),"; "," - additional text added on if test is met"&"; ",COLUMN(J1000)) ....

& that wont be the end of it. There are " - additional text 2 added on if test is met", "additional text 3 added on if test is met", " - additional text 4 added on if test is met" and " - additional text 5 added on if test is met" do this for too, aswell.

Not to mention that the number of "; " delimiters will increase over time to go above 15, so go well over beyind the 7 nested if function limit (if I ever complete the above - its only valie for the first 2 instances at the moment). Hence my need for a something more dynamic or a udfmacro.

In the end i accomplished by goal another way, but want this here for providence (for me!) in case if anyone can provide some pointers or knows a dynamic substitute udf I could use [idealy , give it the positions you want to replace for, and it does them all and leaves the others unchaged, so you have a new cell will some changed and some not). If not, id have to work out one myself one day. Thanks.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Forum statistics

Threads
1,214,976
Messages
6,122,541
Members
449,089
Latest member
davidcom

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