+ Reply to Thread
Results 1 to 16 of 16

Excel Encoding

  1. #1
    Registered User
    Join Date
    03-21-2017
    Location
    Colombo
    MS-Off Ver
    2010
    Posts
    16

    Excel Encoding

    i want to know if it is possible to change a Excel Cell Data to letters
    for a examplei have a set of codes represents each letter
    like
    1=M , 2=O, 3=D , 4=E, 5=R , 6=N , 7=L , 8=I , 9=C , 0=A

    so a cell date is 10 the answer should be MA Eg ( 1=M, A=0 ) 10=MA
    so a cell date is 100 the answer should be MAA Eg ( 1=M, A=0 , A=0 ) 100=MAA
    so a cell date is 500 the answer should be RAA Eg (5=R , A=0, A=0 500=RAA
    so a cell data is 750 the answer should be LRA Eg (7=L , 5=R , A=0 ) 750 =LRA
    so a cell data is 1750 the answer should be LRA Eg (1=M ,7=L , 5=R , A=0 ) 1750 =MLRA

    encryption! Can this be Done?

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Excel Encoding

    Hi fariskhan and welcome to the forum,

    Sure, this can be done. I used to give this problem to a group of students. I'd tell them that each letter in the USA alphabet was equal to a unique number between 1 and 26. Then I'd give them what each state's letters would add up to and ask them to unencrypt the individual letters.

    OHIO = 55
    CALIFORNIA = 124
    ...

    It is pretty easy to make up this list after you have assigned the values to each letter.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    03-21-2017
    Location
    Colombo
    MS-Off Ver
    2010
    Posts
    16

    Re: Excel Encoding

    MarvinP!
    Promt Reply!
    I wonder How to do this !!Any Helps ?

  4. #4
    Registered User
    Join Date
    03-21-2017
    Location
    Colombo
    MS-Off Ver
    2010
    Posts
    16

    Re: Excel Encoding

    This is For Encoding Price of the Items Ranging from 0$ to 99999$
    Using only 10 Alphabets .. Like "0-9" ,"10-99,"100-999","1000-99000".
    I wonder How to Do this ,,,,,


    my Email is [email protected] any tutorials ?

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Excel Encoding

    Hi,

    We really need an example of what you have and what an answer would look like.


    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  6. #6
    Registered User
    Join Date
    03-21-2017
    Location
    Colombo
    MS-Off Ver
    2010
    Posts
    16

    Re: Excel Encoding

    I have Uploaded the File
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    08-28-2015
    Location
    Melbourne, AUS
    MS-Off Ver
    2011
    Posts
    59

    Re: Excel Encoding

    Using a table in A1:B10, the below works for up to 4 digits.

    =IF(LEN(D1)=1,VLOOKUP(D1,A:B,2,0),IF(LEN(D1)=2,VLOOKUP(NUMBERVALUE(LEFT(D1,1)),A:B,2,0)&VLOOKUP(NUMBERVALUE(MID(D1,2,1)),A:B,2,0),IF(LEN(D1)=3,VLOOKUP(NUMBERVALUE(LEFT(D1,1)),A:B,2,0)&VLOOKUP(NUMBERVALUE(MID(D1,2,1)),A:B,2,0)&VLOOKUP(NUMBERVALUE(MID(D1,3,1)),A:B,2,0),IF(LEN(D1)=4,VLOOKUP(NUMBERVALUE(LEFT(D1,1)),A:B,2,0)&VLOOKUP(NUMBERVALUE(MID(D1,2,1)),A:B,2,0)&VLOOKUP(NUMBERVALUE(MID(D1,3,1)),A:B,2,0)&VLOOKUP(NUMBERVALUE(MID(D1,4,1)),A:B,2,0),""))))

    Table:
    1 M
    2 O
    3 D
    4 E
    5 R
    6 N
    7 L
    8 I
    9 C
    0 A

  8. #8
    Registered User
    Join Date
    08-28-2015
    Location
    Melbourne, AUS
    MS-Off Ver
    2011
    Posts
    59

    Re: Excel Encoding

    Corrrected for your sheet. And 5 digits

    =IF(LEN(B3)=1,VLOOKUP(B3,E:F,2,0),IF(LEN(B3)=2,VLOOKUP(NUMBERVALUE(LEFT(B3,1)),E:F,2,0)&VLOOKUP(NUMBERVALUE(MID(B3,2,1)),E:F,2,0),IF(LEN(B3)=3,VLOOKUP(NUMBERVALUE(LEFT(B3,1)),E:F,2,0)&VLOOKUP(NUMBERVALUE(MID(B3,2,1)),E:F,2,0)&VLOOKUP(NUMBERVALUE(MID(B3,3,1)),E:F,2,0),IF(LEN(B3)=4,VLOOKUP(NUMBERVALUE(LEFT(B3,1)),E:F,2,0)&VLOOKUP(NUMBERVALUE(MID(B3,2,1)),E:F,2,0)&VLOOKUP(NUMBERVALUE(MID(B3,3,1)),E:F,2,0)&VLOOKUP(NUMBERVALUE(MID(B3,4,1)),E:F,2,0),IF(LEN(B3)=5,VLOOKUP(NUMBERVALUE(LEFT(B3,1)),E:F,2,0)&VLOOKUP(NUMBERVALUE(MID(B3,2,1)),E:F,2,0)&VLOOKUP(NUMBERVALUE(MID(B3,3,1)),E:F,2,0)&VLOOKUP(NUMBERVALUE(MID(B3,4,1)),E:F,2,0)&VLOOKUP(NUMBERVALUE(MID(B3,5,1)),E:F,2,0),"")))))

  9. #9
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,908

    Re: Excel Encoding

    Try this ...
    Please Login or Register  to view this content.
    Use:
    =Encoding(B3,$E$2:$F$11)

  10. #10
    Forum Contributor
    Join Date
    08-04-2004
    Location
    Amsterdam
    MS-Off Ver
    2016
    Posts
    186

    Re: Excel Encoding

    For a formula I'd have gone for a bunch of nested substitute formulas
    Please Login or Register  to view this content.
    Last edited by philaugust2004; 03-21-2017 at 07:03 PM.

  11. #11
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Excel Encoding

    Mine is close to Phil's above..

    =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TEXT(B3,"#"),"0","A"),"1","M"),"2","O"),"3","D"),"4","E"),"5","R")

    You will need to add a few levels of substitute to get 6,7,8,9,

  12. #12
    Registered User
    Join Date
    03-21-2017
    Location
    Colombo
    MS-Off Ver
    2010
    Posts
    16

    Re: Excel Encoding

    I added Substitutes to MarvinP Code as Follows

    =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TEXT(B3,"#"),"0","A"),"1","M"),"2","O"),"3","D"),"4","E"),"5","R"),"6","N"),"7","L"),"8","I"),"9","C")

    This Code works like charm ,,,Thanks MarvinP! Thank you Everyone , This Forum is Amazing,,,,,,,,,, The members are Awesome.....Thumbs Up

  13. #13
    Registered User
    Join Date
    03-21-2017
    Location
    Colombo
    MS-Off Ver
    2010
    Posts
    16

    Re: Excel Encoding

    Hello Members,
    With the great help I achieved through this group, I would like to thanks everyone helped in overcome my previous problem related to Substitute Function..
    As Per now, I have a very important Issue to discuss with the Great Team here and to get help if possible..
    There are 3 sheets in my excel sheet.

    1.Inventory (the stock details page)

    2.Generator (The bar code generator using concatenate function using ccode39 font )

    3. Print Page (page to print Barcode sticker in a4 sheet)

    *screenshots and actual Excel File is attached
    -The Stock details are entered in the inventory page and it holds the data of the stock. After entering the details of the stock in inventory page, the Generator page creates each and every barcode as per the Stock code using ccode 39 font followed with the item description using concatenate function and the price and the print sticker quantity.
    Now the trick is in Print Page, after the data is created in generator page, the print sheet should be filed with the bar code in order to be printed on a A4 sheet including description and the price according to the number of sticker needed to print. I do this manually pasting it from the barcode page data to the print page which consumes more time and wrong sticker count as human error..
    So I wonder if there is any way that this could be done automatically to past the details to the print page from generator to print sheet with actual number of stickers needed using the data form generator page. And the print sheet row cannot be filled more than four barcodes in a column as in sample ,as printer will not print if it goes beyond the print range..
    Hope this sounds bit weird and need an inventory system to do my work, But still I try it do it with Excel as I love working in Excel like a boss….

    Thanks..
    Attached Images Attached Images
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    03-21-2017
    Location
    Colombo
    MS-Off Ver
    2010
    Posts
    16

    Re: Excel Encoding

    Quote Originally Posted by MarvinP View Post
    Mine is close to Phil's above..

    =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TEXT(B3,"#"),"0","A"),"1","M"),"2","O"),"3","D"),"4","E"),"5","R")

    You will need to add a few levels of substitute to get 6,7,8,9,
    This code worked for me ,To change Numbers to code .......................
    EG.. 101 = MAM

    But HOW we do it other way round to change a Code to Text ??
    eg... MAM = 101 ???

    i tried editing code but it does not work..

    Please Help..

  15. #15
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Excel Encoding

    =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TEXT(B3,"#"),"0","A"),"1","M"),"2","O"),"3","D"),"4","E"),"5","R")

    Reverse the A and 0, the 1 and M, ...
    Entia non sunt multiplicanda sine necessitate

  16. #16
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Excel Encoding

    Or ...

    A
    B
    1
    DAMNRECOIL
    2
    3016549287
    A2: =SUMPRODUCT(FIND(MID(A1, ROW(INDIRECT("1:" & LEN(A1))), 1), "AMODERNLIC") - 1, 10^(LEN(A1) - ROW(INDIRECT("1:" & LEN(A1)))))

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 05-23-2014, 05:44 AM
  2. Replies: 1
    Last Post: 01-04-2013, 07:43 PM
  3. Reading from XML to Excel using VBA: Unicode encoding error
    By Upparna in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-05-2012, 04:00 PM
  4. Encoding problem with excel 2007
    By Nikoko in forum Excel General
    Replies: 1
    Last Post: 04-18-2010, 12:17 PM
  5. How to change encoding for posting data from Excel 2007?
    By emmanuellecc in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-03-2009, 03:51 PM
  6. Excel File Character Encoding
    By cbelobr in forum Excel General
    Replies: 1
    Last Post: 06-05-2009, 05:03 PM
  7. [SOLVED] Excel 2003 and Content-Encoding:gzip
    By Nicklas Karlsson in forum Excel General
    Replies: 0
    Last Post: 05-04-2005, 03:06 AM

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