Replace multiple specific pieces of text in a cell

JTH94BT

New Member
Joined
Jul 11, 2024
Messages
13
Office Version
  1. 365
Platform
  1. Windows
Hi everyone,

I'd like to be able to find and replace multiple strings of text in a single cell using one formula.

e.g.

cell A1 = "Daytime 20.50, Evening and Weekend 11.75"

cell A2 old text = 20.50
cell A3 old text = 11.75
cell B2 new text = 22.50
cell B3 new text = 12.50

What formula can I write to achieve the following outcome in cell B1? = "Daytime 22.50, Evening and Weekend 12.50"
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Hi everyone,

I'd like to be able to find and replace multiple strings of text in a single cell using one formula.

e.g.

cell A1 = "Daytime 20.50, Evening and Weekend 11.75"

cell A2 old text = 20.50
cell A3 old text = 11.75
cell B2 new text = 22.50
cell B3 new text = 12.50

What formula can I write to achieve the following outcome in cell B1? = "Daytime 22.50, Evening and Weekend 12.50"
Don't worry guys I've worked it out! I used =SUBSTITUTE(SUBSTITUTE(A1,A2,B2),A3,B3)
 
Upvote 0
Solution
1732028300378.png


Formula in cell B1:
Excel Formula:
=SUBSTITUTE(SUBSTITUTE(A1,A2,B2),A3,B3)
 
Upvote 0
I see that you found the answer while I was typing up my reply.
Nice job!
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,162
Members
453,021
Latest member
Justyna P

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