+ Reply to Thread
Results 1 to 3 of 3

sub-label column

  1. #1
    Registered User
    Join Date
    05-21-2009
    Location
    New York, NY
    MS-Off Ver
    Excel 2007
    Posts
    2

    sub-label column

    I am trying to create a field of sub-labels. I have a column labeled with numbers, but many repeat. See below:

    1
    1
    2
    2
    2
    3
    4
    4
    4
    4
    5
    etc......

    And I am trying to create a column where I can uniquely identify these numbers. See below:
    1A
    1B
    2A
    2B
    2C
    3A
    4A
    4B
    4C
    4D
    5A
    etc.....

    Does anyone know a Macro or anyway I can create these letters inside of a column, relating to the numbers?

    Thanks a lot!

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454

    Re: sub-label column

    OK,

    Presuming your data starts at A1, fill in B1 manually (in your example type in 1A), then in B2 enter this

    =IF(A2=A1,A2&INDEX({"B","C","D","E","F","G","H"},MATCH(RIGHT(B1,1),{"A","B","C","D","E","F","G"},1)),A2&"A")

    and copy it down your data.

    Extend the range of letters as you require
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: sub-label column

    Another slight variant of that could be:

    B1: =A1&INDEX({"A","B","C","D","E"},COUNTIF($A$1:$A1,$A1))
    copied down

    You would need to ensure if using letters etc that your INDEX includes the necessary amount of options... create them in a list and refer to it in the INDEX ... you could also use Cell address info rather than creating a list but then the function would become volatile (bad).

+ 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