Formula help

excelesha

Board Regular
Joined
Apr 19, 2023
Messages
65
Office Version
  1. 365
Platform
  1. Windows
Hello, please I am trying to replace the "4" that comes right after the lettes to "5", but the position of the 4 changes depending on the number of letter in front of it:
Unit 4Unit 5
27BFWW470127BFWW5701
27BD451427BD5514
27AEUEA421427AEUEA5214

I have about 2000 rows that I need to modify to "5". The thing that is consistent is that the 4 comes right after the letters. Thank you in advance.
 
Based on your examples, the first 2 characters do not have a 4.
So enough with this:

Dante Amor
AB
1Unit 4Unit 5
227BFWW470127BFWW5701
327BD451427BD5514
427AEUEA421427AEUEA5214
527ADE-454627ADE-5546
Hoja4
Cell Formulas
RangeFormula
B2:B5B2=SUBSTITUTE(A2,"4","5",1)

:)
wow, works amazingly! Yes, haha, so far I did not run into a case with a 4 in the first two characters.

Thank you SO MUCH AGAIN.
 
Upvote 0

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
The formula also considers in case there is no 4. Try this

Dante Amor
AB
1Unit 4Unit 5
227BFWW470127BFWW5701
327BD451427BD5514
427AEUEA421427AEUEA5214
542AS12342AS123
642AS43242AS532
727BD460427BD5604
Hoja4
Cell Formulas
RangeFormula
B2:B7B2=LEFT(A2,2)&SUBSTITUTE(MID(A2,3,99),"4","5",1)


The change is small, just add this part:
=LEFT(A2,2)&SUBSTITUTE(MID(A2,3,99),"4","5",1)

;)
@DanteAmor , you know what, I noticed this formula works too, even if there is a "-" in the characters.
 
Upvote 0

Forum statistics

Threads
1,216,082
Messages
6,128,702
Members
449,464
Latest member
againofsoul

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