+ Reply to Thread
Results 1 to 6 of 6

Give an ID number against a given name name.

  1. #1
    Registered User
    Join Date
    09-20-2011
    Location
    N.Wales
    MS-Off Ver
    Excel 2010
    Posts
    63

    Give an ID number against a given name name.

    Hi,

    I have column A1 that contains names eg ..

    Jones
    Jones
    Jones
    Williams
    Williams
    Davies
    Davies
    Davies
    Davies

    I would like column A2 to automatically generate in numerical order an ID number - All Jones = 1 Williams = 2 and so on.

    Jones 1
    Jones 1
    Jones 1
    Williams 2
    Williams 2
    Davies 3
    Davies 3
    Davies 3
    Davies 3

    The names in column A1 will change from sheet to sheet - but will always start with ID 1.

    Cheers for all your help

    WCE

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Give an ID number against a given name name.

    Put this formula in B2 if your data starts in A2
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Put this formula in B3 and drag down
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Give an ID number against a given name name.

    With your Names starting in A1 and down, in B1 type 1. In B2 anf copy down, use this formula.

    =IF(A2="","",IF(COUNTIF($A$1:A2,A2)>1,INDEX($B$1:B1,MATCH(A2,$A$1:A2,0)),MAX($B$1:B1)+1))
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  4. #4
    Registered User
    Join Date
    09-20-2011
    Location
    N.Wales
    MS-Off Ver
    Excel 2010
    Posts
    63

    Re: Give an ID number against a given name name.

    Fantastic - Cheers

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Give an ID number against a given name name.

    .....................

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Give an ID number against a given name name.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

+ 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