+ Reply to Thread
Results 1 to 3 of 3

Assign a number to on the left row to unique entries on a list

  1. #1
    Registered User
    Join Date
    08-22-2017
    Location
    LA
    MS-Off Ver
    2016
    Posts
    1

    Assign a number to on the left row to unique entries on a list

    Hi,

    I have a list of names that has some repeated values, I would like to be able to put a number that identifies each unique name and repeats for each unique entry.

    It is the same concept as in

    https://www.excelforum.com/excel-for...in-a-list.html

    where they use the formula:

    =IF(COUNTIF(A$2:A2,A2)=1,MAX(B$1:B1)+1,VLOOKUP(A2,A$1:B1,2,0))

    in this case this puts it in the column to the right but I need it in the column to the left and after playing with the formula for 2 hours I cant figure it out.

    Here is an example of my list:

    Excel Forum Question.png

    I would like the numbering on the left. If it matters this list will be about 5000 names long, and I will copy them into the list.

    If you guys and gals can help me up to here I will be very appreciative.


    As a plus, if we can include a two letter identifier to the numbering like for KC0001 it will be also great to see how this formula will look just in case I need to do this in the future.

    THANKS FOR ALL YOUR HELP!

    Oscar

  2. #2
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Assign a number to on the left row to unique entries on a list

    Welcome to the forum.

    You have two problems with trying to use that formula as it is:
    1. The uniqueness of each name is a combination of First Name and Last Name Initial, so the check needs to be done using both;
    2. VLOOKUP only works when the value being looked up is in the first column of the table.

    Luckily, there are solutions to both:
    1. We can Concatenate the names in another column and check that (this is called using a 'helper column';
    2. We can use Index-Match instead of VLookup.

    First, put this formula in D3 and drag down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Then put this in A3 and drag down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    You can hide column D if you want. Or, if you have data in column D already which is being used in other formulae and you don't want to worry about changes, you can put the above formula in another empty column (Z, or AB, or CD, or whatever) and just change the references in the formula for column A. (I hope that makes sense!)

    I'm not clear on your follow-up question about the two-letter identifier. Will this identifier always be the same or will it change? If it changes, where does it come from?

    Hope the above helps - if anything doesn't make sense, get back to us.
    Regards,
    Aardigspook

    I recently started a new job so am a bit busy and may not reply quickly. Sorry - it's not personal - I will reply eventually.
    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
    If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
    You don't need to give me rep if I helped, but a thank-you is nice.

  3. #3
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Assign a number to on the left row to unique entries on a list

    Hi all- This approach generates codes instead of numbers. Paste this in D3 and copy down:
    Please Login or Register  to view this content.
    Row\Col
    A
    B
    C
    2
    Code First Name Initial
    3
    KC0001 Trey W
    4
    KC0002 Fran E
    5
    KC0003 Herb P
    6
    KC0004 Jon K
    7
    KC0005 Will O
    8
    KC0004 Jon K
    9
    KC0002 Fran E
    10
    KC0001 Trey W
    11
    KC0006 Bonny T
    12
    KC0001 Trey W
    13
    KC0003 Herb P
    14
    KC0001 Trey W
    15
    KC0001 Trey W
    16
    KC0005 Will O


    Please click the Add Reputation star below any helpful posts, and use Thread Tools (up top) to mark your thread as SOLVED once you have your answer. Thanks!-Lee

+ 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. [SOLVED] Count the number of occurrence upto now and assign a unique sequence number
    By chathuranga in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-22-2016, 07:25 AM
  2. Generating a unique list of entries but removing some entries.
    By Kramxel in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-14-2015, 11:42 AM
  3. Macro to create unique id from email address and assign to repeated entries
    By capson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-10-2014, 11:26 PM
  4. Replies: 7
    Last Post: 05-11-2012, 02:00 PM
  5. Using VBA: I have a list with multiple entries.Need to reduce down to unique entries
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-25-2011, 03:19 PM
  6. Duplicate Entries into List of Unique Entries
    By MjRmatt in forum Excel General
    Replies: 1
    Last Post: 08-18-2010, 11:53 AM
  7. assign a unique number
    By saziz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-25-2006, 08:56 PM

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