+ Reply to Thread
Results 1 to 5 of 5

assign a numerical value to alphabets

  1. #1
    Registered User
    Join Date
    09-05-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    1

    Question assign a numerical value to alphabets

    Hi,
    I have problems with assigning a numeric value to some letters. i want to use these letters instead of numbers. Is it possible for the excel to read a letter as number like:
    I=0
    J=1
    K=2
    L=3
    M=4
    N=5
    O=6
    P=7
    Q=8
    R=9
    AND when i type or enter III IN A1 THEN B1 SHOULD SOW THE VALUE OF A1.. i.e, FOR EXAMPLE IF I WOULD ENTER III IN A1 THEN B2 SHOULD SHOW 000, IF I WOULD TYPE OR ENTER IJK IN A1 THEN B2 SHOULD SHOW 012

    Please help me with this.
    Thank you very much
    Last edited by saddamkafil; 09-05-2012 at 03:41 PM.

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,082

    Re: assign a numerical value to alphabets

    Assuming you're always gonna enter a 3 character reference
    this will work
    =CODE(MID(A1,1,1))-73&CODE(MID(A1,2,1))-73&CODE(MID(A1,3,1))-73

    Its based on ASCII codes rather than a lookup table
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

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

    Re: assign a numerical value to alphabets

    Or

    =TEXT(SUMPRODUCT(CODE(MID(A1, {1,2,3}, 1))-73, {100,10,1}), "000")
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: assign a numerical value to alphabets

    saddamkafil,

    Welcome to the Excel Forum.


    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

    1. Copy the below code, by highlighting the code and pressing the keys CTRL + C
    2. Open your workbook
    3. Press the keys ALT + F11 to open the Visual Basic Editor
    4. Press the keys ALT + I to activate the Insert menu
    5. Press M to insert a Standard Module
    6. Where the cursor is flashing, paste the code by pressing the keys CTRL + V
    7. Press the keys ALT + Q to exit the Editor, and return to Excel


    Please Login or Register  to view this content.

    To use the Function TxtToNbrV2:

    If cell A1 = IJK

    The function in cell B1
    =TxtToNbrV2(A1)

    B1 will display 012
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  5. #5
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: assign a numerical value to alphabets

    late to the game, and based on @shg's idea, this is a slightly more "elastic" approach:
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

+ 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