+ Reply to Thread
Results 1 to 10 of 10

Turning a 6 or 7 digit number into a code containing numbers and letters.

  1. #1
    Registered User
    Join Date
    07-02-2012
    Location
    Georgia
    MS-Off Ver
    Excel 2007
    Posts
    6

    Talking Turning a 6 or 7 digit number into a code containing numbers and letters.

    Hi, I am new to Excel Forum and to complicated Excel programming. I am having trouble converting manufacturer part numbers into our part number code.

    We Currently Code product numbers by using the following formula.

    0 = P
    1 = A
    2 = B
    3 = C
    4 = E
    5 = F
    6 = H
    7 = K
    8 = M
    9 = N

    The manufacturer part numbers are 6 or 7 digits long. They are converted starting from right to left. The second number is converted to a letter and the fifth number is converted to a letter.

    ex 1: 274794 = 2K47N4
    ex 2: 1022223 = 10B22B3

    A "T" is added to the front of the code and an "S" is added to the back. The completed code looks like this.

    ex 1: 274794 = T2K47N4S
    ex 2: 1022223 = T10B22B3S

    Is there a way for excel to do this for me automatically? I have about 10,000 numbers to convert ...

    Any help is appreciated.

    -Matthew

  2. #2
    Forum Contributor
    Join Date
    02-12-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2007
    Posts
    275

    Re: Turning a 6 or 7 digit number into a code containing numbers and letters.

    Hi mathew

    Where is the code entered and where does the result get displayed?

  3. #3
    Registered User
    Join Date
    07-02-2012
    Location
    Georgia
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Turning a 6 or 7 digit number into a code containing numbers and letters.

    The manufacturer part number is in, column B. The code (result) needs to be displayed in column C.

  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Turning a 6 or 7 digit number into a code containing numbers and letters.

    Matthew,

    Welcome to the forum! Assuming the manufacturer part number is in cell A1 and down, put this in B1 and copy down:
    Please Login or Register  to view this content.

    [EDIT]:
    Just saw your post, here's the corrected formula to reference column B:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  5. #5
    Registered User
    Join Date
    07-02-2012
    Location
    Georgia
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Turning a 6 or 7 digit number into a code containing numbers and letters.

    You guys are awesome!! Thanks for the help. It worked and saved me HOURS of work.

    Best regards,
    Matthew Cucuzza

  6. #6
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Turning a 6 or 7 digit number into a code containing numbers and letters.

    Came up with an alternate (slightly shorter):

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    07-02-2012
    Location
    Georgia
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Turning a 6 or 7 digit number into a code containing numbers and letters.

    Sorry to revive such an old thread. It has been a few years since I asked for help converting our part numbers into codes, now I find myself in a position where I need to be able to turn the codes back into part numbers.

    My original questions was:

    "We Currently Code product numbers by using the following formula.

    0 = P
    1 = A
    2 = B
    3 = C
    4 = E
    5 = F
    6 = H
    7 = K
    8 = M
    9 = N

    The manufacturer part numbers are 6 or 7 digits long. They are converted starting from right to left. The second number is converted to a letter and the fifth number is converted to a letter.

    ex 1: 274794 = 2K47N4
    ex 2: 1022223 = 10B22B3

    A "T" is added to the front of the code and an "S" is added to the back. The completed code looks like this.

    ex 1: 274794 = T2K47N4S
    ex 2: 1022223 = T10B22B3S

    Is there a way for excel to do this for me automatically? I have about 10,000 numbers to convert ..."

    I used the formulas given above to convert these original part numbers into our codes, but would now like to convert our codes back to original part numbers to generate a specific report.

    Would anyone be willing to help out with this?

    Any help is very much appreciated.

    Thanks again,
    Matthew

  8. #8
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Turning a 6 or 7 digit number into a code containing numbers and letters.

    Hello Matthew,

    You can convert it back using this formula:
    =REPLACE( REPLACE (MID(A1,2,LEN(A1)-2),LEN(A1)-6,1,SEARCH(MID(A1,LEN(A1)-5,1),"PABCEFHKMN")-1),LEN(A1)-3,1,SEARCH(MID(A1,LEN(A1)-2,1),"PABCEFHKMN")-1)

  9. #9
    Registered User
    Join Date
    07-02-2012
    Location
    Georgia
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Turning a 6 or 7 digit number into a code containing numbers and letters.

    Great!

    Thanks again, I just had to modify it a little to make it work for me. Perfect!

    Have a good weekend

  10. #10
    Registered User
    Join Date
    07-02-2012
    Location
    Georgia
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Turning a 6 or 7 digit number into a code containing numbers and letters.

    Great!

    Thanks again, I just had to modify it a little to make it work for me. Perfect!

    Have a good weekend

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1