function that will in c1 take the sentence

mgm90210M

Board Regular
Joined
Feb 14, 2013
Messages
92
abcdefg
2id
3ronld com co ifronldco
4com dandancom
5guy id mano roimanoroi
6roni soares fri mitosoares fri mitoguy
7roni

<tbody>
</tbody>




please i need in c3 function until c6 a function that
will in
c1 take the sentence in b3 and remove the word that in g colom ( g2 antil g7)

the word will remove please
and will include space instant of the word that remove

like in b6 remove only "roni" that include in g column


it is imported to Pay attention that when in g column have the word "com"

the function only delete "com"
and not "
commmg"



thanks
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
To get you started,

=trim(substitute(SUBSTITUTE(" "&B3&" "," "&$G$2&" "," ")," "&$G$3&" "," "))

Note that this only covers G2 and G3, you will need to add the remaining 4 SUBSTITUTE functions into the formula for each of the remaining cells G4:G7
 
Upvote 0
To get you started,

=trim(substitute(SUBSTITUTE(" "&B3&" "," "&$G$2&" "," ")," "&$G$3&" "," "))

Note that this only covers G2 and G3, you will need to add the remaining 4 SUBSTITUTE functions into the formula for each of the remaining cells G4:G7



  • please i don't know how to do that
    can you please help me
    and include the all function
 
Upvote 0
abcdefg
2id
3ronld com co ifronldco
4com dandancom
5id mano roimanoroi
6roni.soares fri mito.comsoares fri mito.com
7roni.

<tbody>
</tbody>



please can you look on the new table
with the remove of the .com and roni.


can you supply please the full function
 
Upvote 0
Try and do it yourself, then next time maybe you will be able to do your own without asking.

I've done the next one for you and changed the text colour so that you can see it.

=trim(substitute(SUBSTITUTE(" "&B3&" "," "&$G$2&" "," ")," "&$G$3&" "," "))

=trim(substitute(substitute(SUBSTITUTE(" "&B3&" "," "&$G$2&" "," ")," "&$G$4&" "," ")," "&$G$3&" "," "))
 
Upvote 0
please

i need from g2 until g60
i canot do it my self
i dont know anything about the function building in exeal
i try to learn
but i don't understanding the function building process


please help me
 
Upvote 0
First of all you added criteria, .com and roni. something that I didn't see earlier, but which is a significant enough variance from your original example to make the suggested solution fail.

In addition to this, I provided a solution based on the fact that the irregular layout of your example suggested only a small range, G2:G7, now you're changing that to G2:G60.

Given the changes, the solution I suggested is now neither practical or suitable, any other variations could further complicate the solution.
 
Upvote 0
First add this code to the vba editor.

Code:
Option Explicit
Public Function mgmsubstitute(txt As String, rng As Range) As String
Dim cl As Range
    txt = " " & Replace(txt, ".", " ") & " "

        For Each cl In rng
            txt = Replace(txt, " " & cl & " ", " ")
        Next
    mgmsubstitute = Trim(txt)

End Function

Then add the formula to the sheet. =mgmsubstitute(B3,$G$2:$G$60) and fill down.
 
Upvote 0

Forum statistics

Threads
1,214,971
Messages
6,122,517
Members
449,088
Latest member
RandomExceller01

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