replace value

clares

Well-known Member
Joined
Mar 14, 2002
Messages
557
Hi All

Is there a way that I can take a cell value and replace the first two characters with two new characters., for example my current value is 04XXXX and I would like to replace the 04 with 05XXXX, however I cant use the find and replace feature because the XXXX part of the contains 0's aswell and it wants to change them aswell!! I have one column with about 5k rows.

Any help would be much appreciated.

Kind Regards

Peter
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Harvey

Well-known Member
Joined
Nov 18, 2004
Messages
953
this adds one to the number of the first two digits whenever they are "04". Change it to fit your needs.

=IF(LEFT(A1,2)="04",TEXT(LEFT(A1,2)+1,"00") & RIGHT(A1,LEN(A1)-2),A1)
 

Forum statistics

Threads
1,147,690
Messages
5,742,638
Members
423,746
Latest member
Joaogomes

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
Top