+ Reply to Thread
Results 1 to 5 of 5

Generate a column of numbers and letters

  1. #1
    Registered User
    Join Date
    02-01-2017
    Location
    London, England
    MS-Off Ver
    2016
    Posts
    1

    Generate a column of numbers and letters

    Hi... Can anyone help

    I'm after a formula that will do the following.

    Generate a new number in column A every time I enter a new name in column B.
    If I enter the same name in column B, twice, or more, the number is followed by a letter. Like this....

    Column A Column B

    1a Tom
    1b Tom
    1c Tom
    2a Phil
    2b Phil
    3a John
    4a Jerry
    5a Dave

    Can anyone help?

    Thanks

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Generate a column of numbers and letters

    Your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

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

    Re: Generate a column of numbers and letters

    How many times can a name be duplicated?

    1z

    If it's more than 26 then what?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Generate a column of numbers and letters

    See the cross post here, Tony: http://www.excelguru.ca/forums/showt...rs-and-letters

    I offered a solution, but have heard nothing more.

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

    Re: Generate a column of numbers and letters

    Here's how I did it...

    Data Range
    A
    B
    1
    Name
    Code
    2
    Tom
    1a
    3
    Tom
    1b
    4
    Tom
    1c
    5
    Phil
    2a
    6
    Phil
    2b
    7
    John
    3a
    8
    Jerry
    4a
    9
    Dave
    5a
    10
    Karen
    6a
    11
    Karen
    6b
    12
    Karen
    6c
    13
    Karen
    6d


    This formula entered in B2 and copied down:

    =IFERROR(--LEFT(B1,LEN(B1)-1),0)+(A2<>A1)&CHAR(COUNTIF(A$2:A2,A2)+96)

    Assumes the names will be sorted/grouped as is demonstrated in the top post.

+ 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: 8
    Last Post: 01-19-2017, 01:38 PM
  2. Automatic Generate Numbers based on already assigned letters
    By sunil31 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 12-01-2015, 07:48 AM
  3. Automatic Generate Numbers based on already assigned letters
    By sunil31 in forum Excel Formulas & Functions
    Replies: 23
    Last Post: 11-28-2015, 11:44 PM
  4. 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
  5. 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
  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