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,

[TABLE="width: 224"]
<colgroup><col span="2"><col></colgroup><tbody>[TR]
[TD]FB1344V01[/TD]
[TD][/TD]
[TD]FB13440001[/TD]
[/TR]
[TR]
[TD]SK53V02[/TD]
[TD][/TD]
[TD]SK00530002[/TD]
[/TR]
[TR]
[TD]LG331V03[/TD]
[TD][/TD]
[TD]LG03310003[/TD]
[/TR]
[TR]
[TD]PL192V12[/TD]
[TD][/TD]
[TD]PL01920012
[/TD]
[/TR]
</tbody>[/TABLE]

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

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
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,223,886
Messages
6,175,198
Members
452,617
Latest member
Narendra Babu D

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