Soufiane M
Soufiane M

Reputation: 5

Google Sheets formula for substitute text

Hi I'am using Google sheet and I want a function to do this look at the exemple , Exemple :have a cell [A1] contain "HI MY NAME IS SOUFIANE" ..... I want to Substitute "MY" by "you" and Substitute "SOUFIANE" by "Alex" on cell [B1].

can you help me please

I do this formula but it does not work

=SUBSTITUTE(AND(A1, "My", "you"),(B1, "soufiane","Alex"))

Upvotes: 0

Views: 60

Answers (1)

Aresvik
Aresvik

Reputation: 4620

=REGEXREPLACE(A1,"(.*)MY(.*)SOUFIANE","$1you$2Alex")

Upvotes: 2

Related Questions