GOOGLE SHEETS: Formula To Find & Replace / Substitute Multiple Words In A Cell Using Another Cell Reference?

seo4lyf

New Member
Joined
Mar 24, 2021
Messages
1
Office Version
  1. 2019
Platform
  1. Windows
I have a document which has a value contain a sentence some words, I need to replace specific words within the sentance with other words that are specific in specific cells.

Sometimes there are multiple of the same values in one cell and they also can appear in different orders.

Example Doc:
2021-03-24 14_59_51-Vlookup, multiple criteria - excel examples - Google Sheets.png


As an example:
Original: Year Purchased 1994 Year Sold 2000
Replace 1: 1994 Or B2
Replace 2: 2000 Or B3
New Value 1: D2
New Value 2: E3

It would be good if I could have 2 methods of doing this, 1 looking in the original value for specific words and the 2nd looking in a cell to determine the word to be replaced.

In my head I think it should be something like this:

Option 1:
VBA Code:
=SUBSTITUTE(SUBSTITUTE(A2,"b2","c2"),"d2","e2")

Option 2:
Code:
=SUBSTITUTE(SUBSTITUTE(A2,"1994","2004"),"d2","e2")

Come cells may contain 2 or 3 values of the same to be replaced with the same value and some cells may have 3 separate values that need to be replaced with 3 separate values.

FYI I am using Google Sheets and not Excel.
 
Last edited by a moderator:

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Forum statistics

Threads
1,214,639
Messages
6,120,679
Members
448,977
Latest member
dbonilla0331

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