Find, replace, substitute

cunningAce

Board Regular
Joined
Dec 21, 2017
Messages
91
Office Version
  1. 365
Platform
  1. Windows
Hi All,

Hoping you can help me please,

I have several combinations of product codes that I want to change so that all share the same format.

Results should be to keep the first 2 letters,
Next a 4 digit number, so in some of the below examples 53 would become 0053, or 331 would become 0331 (add leading 0's to make the 4 digits)
Finally Remove the letter 'V' and replace with 0's. So 'V01' becomes 0001, or 'V12' becomes 0012.

"2 letters","4 numbers","4 numbers" to make the new 10 character code.

Examples of start and end results,

FB1344V01FB13440001
SK53V02SK00530002
LG331V03LG03310003
PL192V12PL01920012

<colgroup><col span="2"><col></colgroup><tbody>
</tbody>

Hoping for a formula to achieve this is possible,
Thanks in advance.
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Provided your examples are representative then this works:

=LEFT(A1,2)&TEXT(SUBSTITUTE(MID(A1,3,99),"V","00"),"00000000")
 
Upvote 0

Forum statistics

Threads
1,214,625
Messages
6,120,598
Members
448,973
Latest member
ksonnia

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