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

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
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)
 
Upvote 0

Forum statistics

Threads
1,214,523
Messages
6,120,047
Members
448,940
Latest member
mdusw

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