Replace on the Fly

rcb007

Board Regular
Joined
Nov 12, 2020
Messages
90
Office Version
  1. 365
Platform
  1. Windows
I hope this is simple. I am trying to make a formula which can replace part of the value on the fly.

The formula will be in Column C and dragged down. =A1&" - "&B1 is what I am using. I need to change MANHOLE to MH each time it runs into that value.

A1="48inch MANHOLE" B1="R1234" C1="48inch MH - R1234"
A2="24inch INLET" B2="R1234" C2="24inch INLET - R1234"
A3="12inch END CAP" B2="-" C3="12inch END CAD - -"

Thanks for any pointers.
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Sorry for the question but thank you for the help
 
Upvote 0
From what was shown I need to add another If statements to the formula. However I cant seem to find out why it is not working. I need to add a substitute for "END" to become "FLARED".

A1="48inch MANHOLE" B1="R1234" C1="48inch MH - R1234"
A2="24inch INLET" B2="R1234" C2="24inch INLET - R1234"
A3="12inch END CAP" B2="-" C3="12inch END CAD - -"

C1 =IF(A1="*MANHOLE*",(SUBSTITUTE(A1,"MANHOLE","MH")&" - "&B1),IF(A1="*END*",(SUBSTITUTE(A1,"END","FLARED"))),A1&" - "&B1)) ---- Then Drag down formula.

Thank you again.
 
Upvote 0
How about
Excel Formula:
=SUBSTITUTE(SUBSTITUTE(A1,"MANHOLE","MH"),"END","FLARED")&" - "&B1
 
Upvote 0
Thank you. Apparently I am over thinking this.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,634
Messages
6,120,659
Members
448,975
Latest member
sweeberry

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