+ Reply to Thread
Results 1 to 24 of 24

Automatic Generate Numbers based on already assigned letters

  1. #1
    Registered User
    Join Date
    07-19-2004
    Posts
    18

    Automatic Generate Numbers based on already assigned letters

    Hi All,

    I am using Excel 2013 and new to it. I need your expert advise. If answer of this question or similar is already replied, please provide the link to me. I could not find the answer in this forum.

    I have numbers 1 to 9 and these numbers are assigned to letters A to Z. For example number 1 is assigned to, say, A, J, X or Number 7 is assigned to, say, B, E, M and so on.

    Now, whenever I enter any alphabet or letter in any cell, number should show adjacent to that cell. For example, if I enter A in B1 then 1 should show in C1 or J in D2 then 1 should show in E2.

    Thanks in anticipation.

    Suunil

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Automatic Generate Numbers based on already assigned letters

    You want this...

    http://contextures.com/xlFunctions02.html
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Automatic Generate Numbers based on already assigned letters

    If A=1,B=2,C=3,...,I=9,J=1,...,Z=8

    Try in C1:

    =MOD(CODE(B1)-65,9)+1

    with B1 contains upper letter.
    Quang PT

  4. #4
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Automatic Generate Numbers based on already assigned letters

    =INDEX({1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26},SEARCH(B1,"abcdefghijklmnopqrstuvwxyz"))
    Try this and change the numbers as per your needs
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Automatic Generate Numbers based on already assigned letters

    or can try
    =HLOOKUP(B1,{"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z";1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26},2,0)
    Please Login or Register  to view this content.

  6. #6
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Automatic Generate Numbers based on already assigned letters

    Quote Originally Posted by nflsales View Post
    =INDEX({1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26},SEARCH(B1,"abcdefghijklmnopqrstuvwxyz"))
    Try this and change the numbers as per your needs
    Follow your approach, why not MATCH(B1,"abc....xyz",0)?
    Anyway, OP required a 1-9 repeats.

  7. #7
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Automatic Generate Numbers based on already assigned letters

    Hi bebo021999

    OP is assigned number between 1 to 9 for each letter, OP has to change 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26 these numbers as per his needs

  8. #8
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Automatic Generate Numbers based on already assigned letters

    Quote Originally Posted by bebo021999 View Post
    why not MATCH(B1,"abc....xyz",0)?
    Never mind! I am stupid!
    Should be SEARCH instead.

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Automatic Generate Numbers based on already assigned letters

    Quote Originally Posted by nflsales View Post
    or can try
    =HLOOKUP(B1,{"a","b","c","d","e","f","g","h","i","j","k","l",
    "m","n","o","p","q","r","s","t","u","v","w","x","y","z";1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,
    20,21,22,23,24,25,26},2,0)


    Use a lookup table!

  10. #10
    Registered User
    Join Date
    07-19-2004
    Posts
    18

    Re: Automatic Generate Numbers based on already assigned letters

    Guys,

    Thanks for prompt response. I tried all formulas but nothing worked. May be I am doing something wrong as Excel is not my forte. Given below is the exact table for your reference.

    1 2 3 4 5 6 7 8
    A B C D E U O F
    I K G M H V Z P
    J R L T N W
    Q S X
    Y

    I want if I type any alphabet anywhere in sheet, number should come to adjacent or below.

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Automatic Generate Numbers based on already assigned letters

    Quote Originally Posted by sunil31 View Post

    I want if I type any alphabet anywhere in sheet, number should come to adjacent or below.
    "Anywhere in the sheet" is very ambiguous.

    If you really do mean "anywhere" then you'll need an event macro to do this.

  12. #12
    Registered User
    Join Date
    07-19-2004
    Posts
    18

    Re: Automatic Generate Numbers based on already assigned letters

    Quote Originally Posted by Tony Valko View Post
    "Anywhere in the sheet" is very ambiguous.

    If you really do mean "anywhere" then you'll need an event macro to do this.
    Yes Tony, I want anywhere in the sheet. I don't mind if it is solved by macro or VB code (not sure whether both are same). I hope there is no problem with macro if I use it.

  13. #13
    Registered User
    Join Date
    07-19-2004
    Posts
    18

    Re: Automatic Generate Numbers based on already assigned letters

    Quote Originally Posted by bebo021999 View Post
    Follow your approach, why not MATCH(B1,"abc....xyz",0)?
    Anyway, OP required a 1-9 repeats.
    bebo021999,

    What is "OP"?

  14. #14
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Automatic Generate Numbers based on already assigned letters

    Maybe this:

    Untitled.jpg

  15. #15
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Automatic Generate Numbers based on already assigned letters

    Quote Originally Posted by sunil31 View Post
    bebo021999,
    What is "OP"?
    Maybe "Original Post"?

  16. #16
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Automatic Generate Numbers based on already assigned letters

    Unfortunately, I'm not much of a programmer so someone else will need to help you with a macro.

    Good luck!

  17. #17
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Automatic Generate Numbers based on already assigned letters

    =IF(B1="","",INDEX({1,2,3,4,5,8,3,5,1,1,2,3,4,5,7,8,1,2,2,4,6,6,6,3,1,7},SEARCH(B1,"abcdefghijklmnopqrstuvwxyz")))
    Please Login or Register  to view this content.
    Try this

  18. #18
    Registered User
    Join Date
    07-19-2004
    Posts
    18

    Re: Automatic Generate Numbers based on already assigned letters

    Quote Originally Posted by bebo021999 View Post
    Maybe this:

    Attachment 432714
    bebo021999, it worked but only on one cell or I have to copy in all cells where I want. How can I change "B1" to "A1:Z6600"?

  19. #19
    Registered User
    Join Date
    07-19-2004
    Posts
    18

    Re: Automatic Generate Numbers based on already assigned letters

    Quote Originally Posted by nflsales View Post
    =IF(B1="","",INDEX({1,2,3,4,5,8,3,5,1,1,2,3,4,5,7,8,1,2,2,4,6,6,6,3,1,7},SEARCH(B1,"abcdefghijklmnopqrstuvwxyz")))
    Please Login or Register  to view this content.
    Try this
    nflsales, it worked but only on one cell or I have to copy in all cells where I want. How can I change "B1" to whole worksheet or atleast 1000 cells?

  20. #20
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Automatic Generate Numbers based on already assigned letters

    Quote Originally Posted by sunil31 View Post
    bebo021999, it worked but only on one cell or I have to copy in all cells where I want. How can I change "B1" to "A1:Z6600"?
    So you want A1:Z6600 contain A-Z, and in, i.e, AA1:AZ6600 display 1-8?

  21. #21
    Registered User
    Join Date
    07-19-2004
    Posts
    18

    Re: Automatic Generate Numbers based on already assigned letters

    Quote Originally Posted by bebo021999 View Post
    So you want A1:Z6600 contain A-Z, and in, i.e, AA1:AZ6600 display 1-8?
    Sorry if I am not clear with my question.

    I have only one concern. If I type, say A or I, anywhere in the worksheet, their corresponding numbers should show next/below to them. Example, B29 = A, it should show 1 to B30 or C29.

    B29 = A C29 = 1

    or

    B30 = 1

    One more example, AC30 = R, it should show 2 to AC31 or AD30.

    AC30 = R AD30 = 2

    or

    AC31 = 2

    I hope this clarifies.

  22. #22
    Registered User
    Join Date
    07-19-2004
    Posts
    18

    Re: Automatic Generate Numbers based on already assigned letters

    Quote Originally Posted by Tony Valko View Post
    Unfortunately, I'm not much of a programmer so someone else will need to help you with a macro.

    Good luck!
    No problem Tony. Thanks for your help.

  23. #23
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Automatic Generate Numbers based on already assigned letters

    You may be better off posting this in the Excel Programming / VBA / Macros forum:

    http://www.excelforum.com/excel-programming-vba-macros/

  24. #24
    Registered User
    Join Date
    07-19-2004
    Posts
    18

    Re: Automatic Generate Numbers based on already assigned letters

    Quote Originally Posted by Tony Valko View Post
    You may be better off posting this in the Excel Programming / VBA / Macros forum:

    http://www.excelforum.com/excel-programming-vba-macros/
    Thanks Tony. I will do it now.

    Again thanks to everybody who tried to help me.

+ 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. Solving a problem where letters are assigned numbers
    By bambinn in forum Excel General
    Replies: 2
    Last Post: 09-02-2015, 09:06 AM
  2. Generate random Alphanumeric with two letters and three numbers
    By Ochimus in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-25-2015, 09:19 PM
  3. Generate sequential letters and numbers populated on textbox (userform)
    By stewart1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-25-2015, 03:40 PM
  4. Need to generate choices with an assigned probability
    By brundynsummers in forum Excel General
    Replies: 5
    Last Post: 11-10-2013, 09:30 PM
  5. Replies: 1
    Last Post: 10-16-2013, 02:46 PM
  6. Function to Generate Random Numbers and Letters
    By jason_kelly in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-14-2010, 03:39 PM
  7. Auto generate numbers and letters as password
    By _bones_ in forum Excel General
    Replies: 1
    Last Post: 01-01-2010, 07:30 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