Find, replace, substitute

cunningAce

Board Regular
Joined
Dec 21, 2017
Messages
86
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.
 

Some videos you may like

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
8,053
Office Version
365
Platform
Windows
Provided your examples are representative then this works:

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

Watch MrExcel Video

Forum statistics

Threads
1,095,202
Messages
5,443,006
Members
405,212
Latest member
Arnie58

This Week's Hot Topics

  • Copy entire row if CountA <>0 to another sheet
    [B]I want to copy entire row if CountA <>0 for column J7:AM7 (headers on J6:AM6) and so on till the last used cell is column D and paste the...
  • Select last used Row in Table
    I have created a Table in a Worksheet which is locked to prevent user errors and protect formula. Some of the cells require freetext entries which...
  • excel workbook: do not allow certain file name
    Hello all, Don't think this has ever been asked before, but how do I restrict file save [Before_Save Event] if the name of the file being saved...
  • fixing problem autofilter
    hello i need help about my code when i search by code in textbox it doesn't show anything this is my data [ATTACH type="full"...
  • “Weight”
    Hi, i’ve got a long sheet filled with weights such as kg,g,L & ml. i can build a formula to convert kg into g and liter into ml. How ever, my...
  • How to capitalize everything before a certain character?
    In column A, I have some text: Hello good day.mp3 Hello good day.flac etc. I'd like to capitalize everything before the period. I don't need the...
Top